diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-04-20 12:02:02 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-04-20 12:02:02 +0200 |
commit | c020042083b9c0a4e932b562c3bef97c76328e18 (patch) | |
tree | 7cce08cfbc07af7358de4de55c28fd7a6f1682d0 /src/edit.c | |
parent | 8d8aa0a367380f23f0af428fcb66a1a0615bf872 (diff) |
patch 7.4.1753v7.4.1753
Problem: "noinsert" in 'completeopt' is sometimes ignored.
Solution: Set the variables when the 'completeopt' was set. (Ozaki Kiichi)
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/edit.c b/src/edit.c index f4a835485c..080e1ab319 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2761,6 +2761,21 @@ ins_compl_make_cyclic(void) } /* + * Set variables that store noselect and noinsert behavior from the + * 'completeopt' value. + */ + void +completeopt_was_set() +{ + compl_no_insert = FALSE; + compl_no_select = FALSE; + if (strstr((char *)p_cot, "noselect") != NULL) + compl_no_select = TRUE; + if (strstr((char *)p_cot, "noinsert") != NULL) + compl_no_insert = TRUE; +} + +/* * Start completion for the complete() function. * "startcol" is where the matched text starts (1 is first column). * "list" is the list of matches. @@ -3675,13 +3690,6 @@ ins_compl_prep(int c) } - compl_no_insert = FALSE; - compl_no_select = FALSE; - if (strstr((char *)p_cot, "noselect") != NULL) - compl_no_select = TRUE; - if (strstr((char *)p_cot, "noinsert") != NULL) - compl_no_insert = TRUE; - if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET) { /* |