0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.0.0319: insert mode completion does not respect 'backspace'

Problem:    Insert mode completion does not respect "start" in 'backspace'.
Solution:   Check whether backspace can go before where insert started.
            (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2017-02-09 17:37:03 +01:00
parent a9f8ffb634
commit 190b04cdd9
3 changed files with 27 additions and 2 deletions

View File

@@ -3467,10 +3467,13 @@ ins_compl_bs(void)
mb_ptr_back(line, p);
/* Stop completion when the whole word was deleted. For Omni completion
* allow the word to be deleted, we won't match everything. */
* allow the word to be deleted, we won't match everything.
* Respect the 'backspace' option. */
if ((int)(p - line) - (int)compl_col < 0
|| ((int)(p - line) - (int)compl_col == 0
&& ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL)
&& ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL
|| (!can_bs(BS_START) && (int)(p - line) - (int)compl_col
- compl_length < 0))
return K_BS;
/* Deleted more than what was used to find matches or didn't finish