diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-04-11 22:50:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 22:50:17 +0200 |
commit | 85b33fc0426049b5cf3e65bb76aa600272785109 (patch) | |
tree | 0d0b6e0bc8e127182dd9fe3d668b31f213c4d3b6 /src/nvim/testdir/test_textformat.vim | |
parent | 392cb7ac0cf7fd2ede1d3c22c4bbb47f92a55637 (diff) | |
download | rneovim-85b33fc0426049b5cf3e65bb76aa600272785109.tar.gz rneovim-85b33fc0426049b5cf3e65bb76aa600272785109.tar.bz2 rneovim-85b33fc0426049b5cf3e65bb76aa600272785109.zip |
vim-patch:8.2.4737: // in JavaScript string recognized as comment (#18083)
Problem: // in JavaScript string recognized as comment.
Solution: Only check for linecomment if 'cindent' is set. (closes vim/vim#10151)
https://github.com/vim/vim/commit/1655619717ff109ea8bf1002883636d5af345e48
Diffstat (limited to 'src/nvim/testdir/test_textformat.vim')
-rw-r--r-- | src/nvim/testdir/test_textformat.vim | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim index e9f846af7b..b6be3d8861 100644 --- a/src/nvim/testdir/test_textformat.vim +++ b/src/nvim/testdir/test_textformat.vim @@ -278,12 +278,25 @@ func Test_format_c_comment() // END call assert_equal(expected, getline(1, '$')) + + " using 'indentexpr' instead of 'cindent' does not repeat a comment + setl nocindent indentexpr=2 + 3delete + normal 2Gox + let expected =<< trim END + nop; + val = val; // This is a comment + x + END + call assert_equal(expected, getline(1, '$')) + setl cindent indentexpr= + 3delete + normal 2GO let expected =<< trim END nop; val = val; // This is a comment - // END call assert_equal(expected, getline(1, '$')) |