summaryrefslogtreecommitdiff
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 7339ce9c6..fc3eff071 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -3501,7 +3501,7 @@ ins_comp_get_next_word_or_line(
{
char_u *tmp_ptr = ptr;
- if (compl_status_adding())
+ if (compl_status_adding() && compl_length <= (int)STRLEN(tmp_ptr))
{
tmp_ptr += compl_length;
// Skip if already inside a word.