aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-05-07 16:49:36 +0200
committerGitHub <noreply@github.com>2022-05-07 16:49:36 +0200
commit0a00792332add35c23b7cf96618ea317e7383a11 (patch)
tree1e82f58d130262d4c204b189c1f00ecaf92451fc /src/nvim/testdir
parent03471e292d48283379a397dadf902572de91b359 (diff)
downloadrneovim-0a00792332add35c23b7cf96618ea317e7383a11.tar.gz
rneovim-0a00792332add35c23b7cf96618ea317e7383a11.tar.bz2
rneovim-0a00792332add35c23b7cf96618ea317e7383a11.zip
vim-patch:8.2.4907: some users do not want a line comment always inserted (#18463)
Problem: Some users do not want a line comment always inserted. Solution: Add the '/' flag to 'formatoptions' to not repeat the comment leader after a statement when using "o". https://github.com/vim/vim/commit/2bf875f881f7c6f6900bc0eb2a93a552db894109
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_textformat.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim
index b6be3d8861..714539d418 100644
--- a/src/nvim/testdir/test_textformat.vim
+++ b/src/nvim/testdir/test_textformat.vim
@@ -278,6 +278,18 @@ func Test_format_c_comment()
//
END
call assert_equal(expected, getline(1, '$'))
+ 3delete
+
+ " No comment repeated with a slash in 'formatoptions'
+ set fo+=/
+ normal 2Gox
+ let expected =<< trim END
+ nop;
+ val = val; // This is a comment
+ x
+ END
+ call assert_equal(expected, getline(1, '$'))
+ set fo-=/
" using 'indentexpr' instead of 'cindent' does not repeat a comment
setl nocindent indentexpr=2