vim-patch:9.0.0102: reading past end of line with insert mode completion

Problem:    Reading past end of line with insert mode completion.
Solution:   Check text length.
a6f9e30016
This commit is contained in:
zeertzjq
2022-08-24 21:46:06 +08:00
parent 6680002169
commit dd77a00621
2 changed files with 9 additions and 1 deletions

View File

@@ -2813,7 +2813,7 @@ static char_u *ins_comp_get_next_word_or_line(buf_T *ins_buf, pos_T *cur_match_p
} else {
char_u *tmp_ptr = ptr;
if (compl_cont_status & CONT_ADDING) {
if (compl_cont_status & CONT_ADDING && compl_length <= (int)STRLEN(tmp_ptr)) {
tmp_ptr += compl_length;
// Skip if already inside a word.
if (vim_iswordp(tmp_ptr)) {