aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2017-03-04 12:24:49 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2017-03-05 12:02:32 +0900
commit4303399c10b7106ccf350e8a419fe3c15b81c8e0 (patch)
tree593316600650cea8263bf52314b4a4c6b504b87d /src/nvim/edit.c
parentaf63f321295a37e411aac82b56a5548bdbe82877 (diff)
downloadrneovim-4303399c10b7106ccf350e8a419fe3c15b81c8e0.tar.gz
rneovim-4303399c10b7106ccf350e8a419fe3c15b81c8e0.tar.bz2
rneovim-4303399c10b7106ccf350e8a419fe3c15b81c8e0.zip
vim-patch:8.0.0319
Problem: Insert mode completion does not respect "start" in 'backspace'. Solution: Check whether backspace can go before where insert started. (Hirohito Higashi) https://github.com/vim/vim/commit/190b04cdd936f4696c22466b7f077f9371d96580
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index edfd7e7460..ccb4455d03 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -2914,11 +2914,14 @@ static int ins_compl_bs(void)
p = line + curwin->w_cursor.col;
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. */
+ // Stop completion when the whole word was deleted. For Omni completion
+ // 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;
}