aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/insexpand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c
index 09575c64d9..fa08064eb5 100644
--- a/src/nvim/insexpand.c
+++ b/src/nvim/insexpand.c
@@ -2735,7 +2735,8 @@ static int info_add_completion_info(list_T *li)
// Skip the element with the CP_ORIGINAL_TEXT flag at the beginning, in case of
// forward completion, or at the end, in case of backward completion.
match = forward ? match->cp_next
- : (compl_no_select ? match->cp_prev : match->cp_prev->cp_prev);
+ : (compl_no_select && match_at_original_text(match)
+ ? match->cp_prev : match->cp_prev->cp_prev);
while (match != NULL && !match_at_original_text(match)) {
dict_T *di = tv_dict_alloc();