From cb3ea2f04a084a1f1d4f1f9b7986501c9ad7ba81 Mon Sep 17 00:00:00 2001 From: Sumedh Pendurkar Date: Sun, 11 Dec 2016 18:19:19 +0530 Subject: [PATCH] tweaks: word completion checks if the previous char is word-forming character immediately after the first char matches Signed-off-by: Sumedh Pendurkar --- src/text.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/text.c b/src/text.c index c03f3d2..f3dce91 100644 --- a/src/text.c +++ b/src/text.c @@ -3780,6 +3780,11 @@ void complete_a_word(void) if (pletion_line->data[i] != shard[0]) continue; + /* If the match is not a separate word, skip it. */ + if (i > 0 && is_word_mbchar(&pletion_line->data[ + move_mbleft(pletion_line->data, i)], FALSE)) + continue; + /* Compare the rest of the bytes in shard. */ for (j = 1; j < shard_length; j++) if (pletion_line->data[i + j] != shard[j]) @@ -3793,11 +3798,6 @@ void complete_a_word(void) if (!is_word_mbchar(&pletion_line->data[i + j], FALSE)) continue; - /* If the match is not a separate word, skip it. */ - if (i > 0 && is_word_mbchar(&pletion_line->data[ - move_mbleft(pletion_line->data, i)], FALSE)) - continue; - /* If this match is the shard itself, ignore it. */ if (pletion_line == openfile->current && i == openfile->current_x - shard_length) -- 2.7.4