diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-05-23 21:27:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-23 21:27:57 +0800 |
| commit | 4b4643be07e4e9259b3cb05e511e5047778733c1 (patch) | |
| tree | b840362430fd1d5a82768bbddc459c67992b26e3 /src/nvim/testdir | |
| parent | 4c6626f03dc645a426c1e63ca372b96f1073581b (diff) | |
| download | rneovim-4b4643be07e4e9259b3cb05e511e5047778733c1.tar.gz rneovim-4b4643be07e4e9259b3cb05e511e5047778733c1.tar.bz2 rneovim-4b4643be07e4e9259b3cb05e511e5047778733c1.zip | |
vim-patch:8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment (#18717)
Problem: When 'formatoptions' contains "/" wrongly wrapping a long trailing
comment.
Solution: Pass the OPENLINE_FORMAT flag.
https://github.com/vim/vim/commit/7e667788150be617aeac42b0d668618ac33ab9da
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_textformat.vim | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim index 92705cb69f..748af199b2 100644 --- a/src/nvim/testdir/test_textformat.vim +++ b/src/nvim/testdir/test_textformat.vim @@ -289,11 +289,28 @@ func Test_format_c_comment() x END call assert_equal(expected, getline(1, '$')) + + " Comment is formatted when it wraps + normal 2GA with some more text added + let expected =<< trim END + nop; + val = val; // This is a comment + // with some more text + // added + x + END + call assert_equal(expected, getline(1, '$')) + set fo-=/ " using 'indentexpr' instead of 'cindent' does not repeat a comment setl nocindent indentexpr=2 - 3delete + %del + let text =<< trim END + nop; + val = val; // This is a comment + END + call setline(1, text) normal 2Gox let expected =<< trim END nop; |