commit 172776b4598085c70897a0aa0d31a983dcd4c94d
parent 7d8653575f2a1170f0c7651f271c45a15a185d5e
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 16 Feb 2026 09:07:51 +0800
Merge pull request #37884 from zeertzjq/vim-9.2.0007
vim-patch:9.2.{0007,0009}
Diffstat:
4 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
@@ -370,6 +370,9 @@ static bool cin_islabel(void) // XXX
return false;
}
+ if (ind_find_start_CORS(NULL)) {
+ return false; // Don't accept a label in a comment or a raw string.
+ }
// Only accept a label if the previous line is terminated or is a case
// label.
pos_T cursor_save;
diff --git a/test/old/testdir/gen_opt_test.vim b/test/old/testdir/gen_opt_test.vim
@@ -336,13 +336,13 @@ let test_values = {
\ 'timeout:-1', 'file:/tmp/file', 'expr:Func()', 'double,33'],
\ ['xxx', '-1', 'timeout:', 'best,double', 'double,fast']],
\ 'splitkeep': [['cursor', 'screen', 'topline'], ['xxx']],
- \ 'statusline': [['', 'xxx'], ['%{', '%{%', '%{%}', '%(', '%)']],
+ \ 'statusline': [['', 'xxx'], ['%^', '%{', '%{%', '%{%}', '%(', '%)']],
"\ 'swapsync': [['', 'sync', 'fsync'], ['xxx']],
\ 'switchbuf': [['', 'useopen', 'usetab', 'split', 'vsplit', 'newtab',
\ 'uselast', 'split,newtab'],
\ ['xxx']],
\ 'tabclose': [['', 'left', 'uselast', 'left,uselast'], ['xxx']],
- \ 'tabline': [['', 'xxx'], ['%{', '%{%', '%{%}', '%(', '%)']],
+ \ 'tabline': [['', 'xxx'], ['%^', '%{', '%{%', '%{%}', '%(', '%)']],
\ 'tagcase': [['followic', 'followscs', 'ignore', 'match', 'smart'],
\ ['', 'xxx', 'smart,match']],
\ 'termencoding': [has('gui_gtk') ? [] : ['', 'utf-8'], ['xxx']],
diff --git a/test/old/testdir/test_cindent.vim b/test/old/testdir/test_cindent.vim
@@ -127,7 +127,7 @@ func Test_cindent_func()
bwipe!
endfunc
-func Test_cindent_1()
+func Test_cindent_01()
new
setl cindent ts=4 sw=4
setl cino& sts&
@@ -1127,6 +1127,12 @@ func Test_cindent_1()
a();
}
+ void func() {
+ /* aaaaaa
+ bbbbb:
+ ccccccc */
+ }
+
/* end of AUTO */
[CODE]
@@ -2130,6 +2136,12 @@ func Test_cindent_1()
a();
}
+ void func() {
+ /* aaaaaa
+ bbbbb:
+ ccccccc */
+ }
+
/* end of AUTO */
[CODE]
@@ -2138,7 +2150,7 @@ func Test_cindent_1()
enew! | close
endfunc
-func Test_cindent_2()
+func Test_cindent_02()
new
setl cindent ts=4 sw=4
setl tw=0 noai fo=croq
@@ -2180,7 +2192,7 @@ func Test_cindent_2()
enew! | close
endfunc
-func Test_cindent_3()
+func Test_cindent_03()
new
setl nocindent ts=4 sw=4
@@ -2240,7 +2252,7 @@ func Test_cindent_3()
enew! | close
endfunc
-func Test_cindent_4()
+func Test_cindent_04()
new
setl cindent ts=4 sw=4
@@ -2270,7 +2282,7 @@ func Test_cindent_4()
enew! | close
endfunc
-func Test_cindent_5()
+func Test_cindent_05()
new
setl cindent ts=4 sw=4
setl cino=}4
@@ -2320,7 +2332,7 @@ func Test_cindent_5()
enew! | close
endfunc
-func Test_cindent_6()
+func Test_cindent_06()
new
setl cindent ts=4 sw=4
setl cino=(0,)20
@@ -2383,7 +2395,7 @@ func Test_cindent_6()
enew! | close
endfunc
-func Test_cindent_7()
+func Test_cindent_07()
new
setl cindent ts=4 sw=4
setl cino=es,n0s
@@ -2424,7 +2436,7 @@ func Test_cindent_7()
enew! | close
endfunc
-func Test_cindent_8()
+func Test_cindent_08()
new
setl cindent ts=4 sw=4
setl cino=
@@ -2472,7 +2484,7 @@ func Test_cindent_8()
enew! | close
endfunc
-func Test_cindent_9()
+func Test_cindent_09()
new
setl cindent ts=4 sw=4
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim
@@ -866,6 +866,7 @@ func Test_set_option_errors()
call assert_fails('set rulerformat=%15(%%', 'E542:')
" Test for 'statusline' errors
+ call assert_fails('set statusline=%^', 'E539:') " Nvim: supports %$
call assert_fails('set statusline=%{', 'E540:')
call assert_fails('set statusline=%{%', 'E540:')
call assert_fails('set statusline=%{%}', 'E539:')
@@ -873,6 +874,7 @@ func Test_set_option_errors()
call assert_fails('set statusline=%)', 'E542:')
" Test for 'tabline' errors
+ call assert_fails('set tabline=%^', 'E539:') " Nvim: supports %$
call assert_fails('set tabline=%{', 'E540:')
call assert_fails('set tabline=%{%', 'E540:')
call assert_fails('set tabline=%{%}', 'E539:')