summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-29 18:09:13 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-29 18:09:13 +0000
commitba26367fea3b63df49d274f3d5cca0af38402add (patch)
tree85eb39195c89d138f835691791818bc41593fc0b /src/testdir
parentedc6f103907a004b9e2265e232dc8be8bc594601 (diff)
downloadvim-git-ba26367fea3b63df49d274f3d5cca0af38402add.tar.gz
patch 8.2.3938: line comment start is also found in a stringv8.2.3938
Problem: Line comment start is also found in a string. Solution: Skip line comments in a string.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_textformat.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim
index ccfd36f75..640298929 100644
--- a/src/testdir/test_textformat.vim
+++ b/src/testdir/test_textformat.vim
@@ -261,6 +261,21 @@ func Test_format_c_comment()
END
call assert_equal(expected, getline(1, '$'))
+ " Using "o" does not repeat a comment in a string
+ %del
+ let text =<< trim END
+ nop;
+ val = " // This is not a comment";
+ END
+ call setline(1, text)
+ normal 2Gox
+ let expected =<< trim END
+ nop;
+ val = " // This is not a comment";
+ x
+ END
+ call assert_equal(expected, getline(1, '$'))
+
" Using CTRL-U after "o" fixes the indent
%del
let text =<< trim END