diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-01-31 15:44:54 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-01-31 15:44:54 +0800 |
| commit | ae649650de3509e22ee6fad5cfa72998d40f2a92 (patch) | |
| tree | d20ee547a92c0840e829bdcdc6209f3388f89abc /src/nvim/testdir | |
| parent | f7801fe138d9677c9333650b4d5581489d4b0613 (diff) | |
| download | rneovim-ae649650de3509e22ee6fad5cfa72998d40f2a92.tar.gz rneovim-ae649650de3509e22ee6fad5cfa72998d40f2a92.tar.bz2 rneovim-ae649650de3509e22ee6fad5cfa72998d40f2a92.zip | |
vim-patch:8.2.3938: line comment start is also found in a string
Problem: Line comment start is also found in a string.
Solution: Skip line comments in a string.
https://github.com/vim/vim/commit/ba26367fea3b63df49d274f3d5cca0af38402add
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_textformat.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim index e1d155eba7..052c32214d 100644 --- a/src/nvim/testdir/test_textformat.vim +++ b/src/nvim/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 |