aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/edit.c30
-rw-r--r--src/nvim/ex_docmd.c7
-rw-r--r--src/nvim/option.c5
-rw-r--r--src/nvim/version.c7
4 files changed, 31 insertions, 18 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 667ce1e779..26966b35c1 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1359,6 +1359,9 @@ ins_redraw (
update_screen(0);
}
if (has_event(EVENT_CURSORMOVEDI)) {
+ // Make sure curswant is correct, an autocommand may call
+ // getcurpos()
+ update_curswant();
apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, false, curbuf);
}
if (curwin->w_p_cole > 0) {
@@ -2319,6 +2322,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 +3116,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
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 3d84d7116b..e334e9126d 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1826,9 +1826,10 @@ static char_u * do_one_cmd(char_u **cmdlinep,
correct_range(&ea);
- if (((ea.argt & WHOLEFOLD) || ea.addr_count >= 2) && !global_busy) {
- /* Put the first line at the start of a closed fold, put the last line
- * at the end of a closed fold. */
+ if (((ea.argt & WHOLEFOLD) || ea.addr_count >= 2) && !global_busy
+ && ea.addr_type == ADDR_LINES) {
+ // Put the first line at the start of a closed fold, put the last line
+ // at the end of a closed fold.
(void)hasFolding(ea.line1, &ea.line1, NULL);
(void)hasFolding(ea.line2, NULL, &ea.line2);
}
diff --git a/src/nvim/option.c b/src/nvim/option.c
index b255d47c18..df271e9eb5 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2958,8 +2958,11 @@ did_set_string_option (
}
/* 'completeopt' */
else if (varp == &p_cot) {
- if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK)
+ if (check_opt_strings(p_cot, p_cot_values, true) != OK) {
errmsg = e_invarg;
+ } else {
+ completeopt_was_set();
+ }
}
/* 'pastetoggle': translate key codes like in a mapping */
else if (varp == &p_pt) {
diff --git a/src/nvim/version.c b/src/nvim/version.c
index aeb07077e6..1714661049 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -71,6 +71,7 @@ static char *features[] = {
static int included_patches[] = {
1757,
1755,
+ 1753,
1654,
1652,
1643,
@@ -381,7 +382,7 @@ static int included_patches[] = {
// 1299 NA
// 1298 NA
// 1297 NA
- // 1296,
+ 1296,
// 1295 NA
// 1294 NA
// 1293 NA
@@ -642,7 +643,7 @@ static int included_patches[] = {
// 1038 NA
// 1037,
// 1036,
- // 1035,
+ 1035,
// 1034,
// 1033 NA
1032,
@@ -671,7 +672,7 @@ static int included_patches[] = {
// 1009 NA
// 1008 NA
// 1007,
- // 1006,
+ 1006,
// 1005,
// 1004 NA,
// 1003 NA,