aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/fold.txt7
-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
-rw-r--r--test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua9
-rw-r--r--test/functional/plugin/matchparen_spec.lua36
7 files changed, 79 insertions, 22 deletions
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index 03dd6a61ba..c01ce4a9ca 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -1,4 +1,4 @@
-*fold.txt* For Vim version 7.4. Last change: 2013 Dec 04
+*fold.txt* For Vim version 7.4. Last change: 2016 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -570,8 +570,9 @@ what you type!
When using an operator, a closed fold is included as a whole. Thus "dl"
deletes the whole closed fold under the cursor.
-For Ex commands the range is adjusted to always start at the first line of a
-closed fold and end at the last line of a closed fold. Thus this command: >
+For Ex commands that work on buffer lines the range is adjusted to always
+start at the first line of a closed fold and end at the last line of a closed
+fold. Thus this command: >
:s/foo/bar/g
when used with the cursor on a closed fold, will replace "foo" with "bar" in
all lines of the fold.
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,
diff --git a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
index 1359b45228..2a4c0149fa 100644
--- a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
+++ b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
@@ -31,7 +31,8 @@ local function run_test_with_regexpengine(regexpengine)
h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ
j 0123❤x
- k combinations]])
+ k combinations
+ l ä ö ü ᾱ̆́]])
execute('set re=' .. regexpengine)
@@ -85,6 +86,11 @@ local function run_test_with_regexpengine(regexpengine)
execute([[let @w=':%s#comb[i]nations#œ̄ṣ́m̥̄ᾱ̆́#g']])
execute('@w')
+ -- Line l. Ex command ":s/ \?/ /g" should NOT split multi-byte characters
+ -- into bytes (fixed by vim-7.3.192).
+ execute([[/^l]])
+ execute([[s/ \?/ /g]])
+
-- Additional tests. Test matchstr() with multi-byte characters.
feed('G')
execute([[put =matchstr(\"אבגד\", \".\", 0, 2)]]) -- ב
@@ -123,6 +129,7 @@ local function run_test_with_regexpengine(regexpengine)
i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑ
j 012❤
k œ̄ṣ́m̥̄ᾱ̆́
+ l ä ö ü ᾱ̆́
ב
בג
א
diff --git a/test/functional/plugin/matchparen_spec.lua b/test/functional/plugin/matchparen_spec.lua
new file mode 100644
index 0000000000..d8c1f2d392
--- /dev/null
+++ b/test/functional/plugin/matchparen_spec.lua
@@ -0,0 +1,36 @@
+local helpers = require('test.functional.helpers')
+local Screen = require('test.functional.ui.screen')
+local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute
+
+describe('matchparen', function()
+ local screen
+
+ before_each(function()
+ clear()
+ screen = Screen.new(20,5)
+ screen:attach()
+ screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
+ end)
+
+ it('uses correct column after i_<Up>. Vim patch 7.4.1296', function()
+ execute('set noai nosi nocin')
+ execute('runtime plugin/matchparen.vim')
+ feed('ivoid f_test()<cr>')
+ feed('{<cr>')
+ feed('}')
+
+ -- critical part: up + cr should result in an empty line inbetween the
+ -- brackets... if the bug is there, the empty line will be before the '{'
+ feed('<up>')
+ feed('<cr>')
+
+ screen:expect([[
+ void f_test() |
+ { |
+ ^ |
+ } |
+ {1:-- INSERT --} |
+ ]], {[1] = {bold = true}})
+
+ end)
+end)