[vim] 69/139: patch 7.4.1753 Problem: "noinsert" in 'completeopt' is sometimes ignored. Solution: Set the variables when the 'completeopt' was set. (Ozaki Kiichi)

James McCoy jamessan at debian.org
Fri May 6 04:00:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository vim.

commit c020042083b9c0a4e932b562c3bef97c76328e18
Author: Bram Moolenaar <Bram at vim.org>
Date:   Wed Apr 20 12:02:02 2016 +0200

    patch 7.4.1753
    Problem:    "noinsert" in 'completeopt' is sometimes ignored.
    Solution:   Set the variables when the 'completeopt' was set. (Ozaki Kiichi)
---
 src/edit.c         | 22 +++++++++++++++-------
 src/option.c       |  2 ++
 src/proto/edit.pro |  1 +
 src/version.c      |  2 ++
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/edit.c b/src/edit.c
index f4a8354..080e1ab 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)
     {
 	/*
diff --git a/src/option.c b/src/option.c
index 8a706af..348c37a 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6951,6 +6951,8 @@ did_set_string_option(
     {
 	if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK)
 	    errmsg = e_invarg;
+	else
+	    completeopt_was_set();
     }
 #endif /* FEAT_INS_EXPAND */
 
diff --git a/src/proto/edit.pro b/src/proto/edit.pro
index 2772583..e32b5ba 100644
--- a/src/proto/edit.pro
+++ b/src/proto/edit.pro
@@ -8,6 +8,7 @@ void truncate_spaces(char_u *line);
 void backspace_until_column(int col);
 int vim_is_ctrl_x_key(int c);
 int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int dir, int flags);
+void completeopt_was_set(void);
 void set_completion(colnr_T startcol, list_T *list);
 void ins_compl_show_pum(void);
 char_u *find_word_start(char_u *ptr);
diff --git a/src/version.c b/src/version.c
index 0c50f1a..774ac52 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1753,
+/**/
     1752,
 /**/
     1751,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git



More information about the pkg-vim-maintainers mailing list