aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2016-04-21 06:00:55 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2016-04-22 07:19:25 +0900
commite57238a644cf24f3130caf7d557a081bbd89df4a (patch)
tree9f09cef5cbbc7f4b7cbec762bc7b99b589db35d9 /src/nvim/edit.c
parentcef624ee9e14bf15598219d96f65a6e4932eb935 (diff)
downloadrneovim-e57238a644cf24f3130caf7d557a081bbd89df4a.tar.gz
rneovim-e57238a644cf24f3130caf7d557a081bbd89df4a.tar.bz2
rneovim-e57238a644cf24f3130caf7d557a081bbd89df4a.zip
vim-patch:7.4.1753
Problem: "noinsert" in 'completeopt' is sometimes ignored. Solution: Set the variables when the 'completeopt' was set. (Ozaki Kiichi) https://github.com/vim/vim/commit/c020042083b9c0a4e932b562c3bef97c76328e18
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 3a4b475bc8..bca8b9bff0 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -2319,6 +2319,22 @@ static int ins_compl_make_cyclic(void)
return count;
}
+
+// Set variables that store noselect and noinsert behavior from the
+// 'completeopt' value.
+void completeopt_was_set(void)
+{
+ 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).
@@ -3097,17 +3113,6 @@ static bool ins_compl_prep(int c)
}
- if (strstr((char *)p_cot, "noselect") != NULL) {
- compl_no_insert = FALSE;
- compl_no_select = TRUE;
- } else if (strstr((char *)p_cot, "noinsert") != NULL) {
- compl_no_insert = TRUE;
- compl_no_select = FALSE;
- } else {
- compl_no_insert = FALSE;
- compl_no_select = FALSE;
- }
-
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET) {
/*
* We have just typed CTRL-X and aren't quite sure which CTRL-X mode