mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.1731: characters deleted on completion
Problem: Characters deleted on completion. (Adrià Farrés) Solution: Also check the last item for the ORIGINAL_TEXT flag. (Christian Brabandt, closes #1645)
This commit is contained in:
14
src/edit.c
14
src/edit.c
@@ -3656,7 +3656,9 @@ ins_compl_set_original_text(char_u *str)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
/* Replace the original text entry. */
|
||||
/* Replace the original text entry.
|
||||
* The ORIGINAL_TEXT flag is either at the first item or might possibly be
|
||||
* at the last item for backward completion */
|
||||
if (compl_first_match->cp_flags & ORIGINAL_TEXT) /* safety check */
|
||||
{
|
||||
p = vim_strsave(str);
|
||||
@@ -3666,6 +3668,16 @@ ins_compl_set_original_text(char_u *str)
|
||||
compl_first_match->cp_str = p;
|
||||
}
|
||||
}
|
||||
else if (compl_first_match->cp_prev != NULL
|
||||
&& (compl_first_match->cp_prev->cp_flags & ORIGINAL_TEXT))
|
||||
{
|
||||
p = vim_strsave(str);
|
||||
if (p != NULL)
|
||||
{
|
||||
vim_free(compl_first_match->cp_prev->cp_str);
|
||||
compl_first_match->cp_prev->cp_str = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user