summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-09 17:37:03 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-09 17:37:03 +0100
commit190b04cdd936f4696c22466b7f077f9371d96580 (patch)
tree449a487f34d05e886a1515599c600694e659b9b0 /src/edit.c
parenta9f8ffb6345f5b246944c73b9861fcc53eaa5228 (diff)
patch 8.0.0319: insert mode completion does not respect 'backspace'v8.0.0319
Problem: Insert mode completion does not respect "start" in 'backspace'. Solution: Check whether backspace can go before where insert started. (Hirohito Higashi)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c
index 1164e2032a..bc8652ba41 100644
--- 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