]> granicus.if.org Git - vim/commitdiff
patch 7.4.1753 v7.4.1753
authorBram Moolenaar <Bram@vim.org>
Wed, 20 Apr 2016 10:02:02 +0000 (12:02 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 20 Apr 2016 10:02:02 +0000 (12:02 +0200)
Problem:    "noinsert" in 'completeopt' is sometimes ignored.
Solution:   Set the variables when the 'completeopt' was set. (Ozaki Kiichi)

src/edit.c
src/option.c
src/proto/edit.pro
src/version.c

index f4a835485cb4df42160a4f28564f7c857c006aa7..080e1ab319d3c60c2321064e3dc05849025a47e4 100644 (file)
@@ -2760,6 +2760,21 @@ ins_compl_make_cyclic(void)
     return count;
 }
 
+/*
+ * 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).
@@ -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)
     {
        /*
index 8a706afbd17a22bef1fdf922f6d8acbd6315bd34..348c37af2519246451ae26cffde1f79a189723ba 100644 (file)
@@ -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 */
 
index 27725839f3e12d7f4bd94b34ad8ebf5dfb858546..e32b5ba25acd5268effc4543ecf970949fdb7b88 100644 (file)
@@ -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);
index 0c50f1a281f864276be092356583f83df53d4129..774ac524c216a88cc7612ff2aa9dc7675e5bd892 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1753,
 /**/
     1752,
 /**/