aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-08 21:10:32 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-08 21:10:32 +0800
commit3c75e63bf68f6ee88d1eda31caf042ed132badd9 (patch)
tree7ef48bb661f074258198f8e514976c56ec2daa09 /src/nvim/testdir
parent51b432a7d1aa2a76ccfbf7a50f19c53e1151609f (diff)
downloadrneovim-3c75e63bf68f6ee88d1eda31caf042ed132badd9.tar.gz
rneovim-3c75e63bf68f6ee88d1eda31caf042ed132badd9.tar.bz2
rneovim-3c75e63bf68f6ee88d1eda31caf042ed132badd9.zip
vim-patch:8.2.4326: "o" and "O" copying comment not sufficiently tested
Problem: "o" and "O" copying comment not sufficiently tested. Solution: Add a test case. (closes vim/vim#9718) https://github.com/vim/vim/commit/51ab7c7d0da08aac796acff22a6c075dac579e76 Fix a mistake when porting Vim patch 8.2.3934
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_textformat.vim28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim
index 052c32214d..783793984d 100644
--- a/src/nvim/testdir/test_textformat.vim
+++ b/src/nvim/testdir/test_textformat.vim
@@ -238,7 +238,33 @@ func Test_format_c_comment()
END
call assert_equal(expected, getline(1, '$'))
- " Using "o" repeats the line comment, "O" does not.
+ " Using either "o" or "O" repeats a line comment occupying a whole line.
+ %del
+ let text =<< trim END
+ nop;
+ // This is a comment
+ val = val;
+ END
+ call setline(1, text)
+ normal 2Go
+ let expected =<< trim END
+ nop;
+ // This is a comment
+ //
+ val = val;
+ END
+ call assert_equal(expected, getline(1, '$'))
+ normal 2GO
+ let expected =<< trim END
+ nop;
+ //
+ // This is a comment
+ //
+ val = val;
+ END
+ call assert_equal(expected, getline(1, '$'))
+
+ " Using "o" repeats a line comment after a statement, "O" does not.
%del
let text =<< trim END
nop;