Mercurial > vim
diff src/edit.c @ 10859:64ccb8029e06 v8.0.0319
patch 8.0.0319: insert mode completion does not respect 'backspace'
commit https://github.com/vim/vim/commit/190b04cdd936f4696c22466b7f077f9371d96580
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 9 17:37:03 2017 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Feb 2017 17:45:03 +0100 |
parents | 265268ea1adc |
children | 5780bd3a5a7e |
line wrap: on
line diff
--- a/src/edit.c +++ b/src/edit.c @@ -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