summaryrefslogtreecommitdiffstats
path: root/src/insexpand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/insexpand.c')
-rw-r--r--src/insexpand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/insexpand.c b/src/insexpand.c
index 43fb8ca505..7ede6bd91f 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -3080,7 +3080,7 @@ 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);
+ match = forward ? match->cp_next : (compl_no_select && match_at_original_text(match) ? match->cp_prev : match->cp_prev->cp_prev);
while (match != NULL && !match_at_original_text(match))
{