aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-31 15:44:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-01-31 15:44:54 +0800
commitda3b04a9e07635bab9b0d67e9b16c62c1e59e004 (patch)
tree2d222a0856d50dc0ca7096cd0ee0f641bb5d211a /src/nvim/testdir
parent88ba0774e202126a432521d5cb14bd2187ef65a2 (diff)
downloadrneovim-da3b04a9e07635bab9b0d67e9b16c62c1e59e004.tar.gz
rneovim-da3b04a9e07635bab9b0d67e9b16c62c1e59e004.tar.bz2
rneovim-da3b04a9e07635bab9b0d67e9b16c62c1e59e004.zip
vim-patch:8.2.3934: repeating line comment is undesired for "O" command
Problem: Repeating line comment is undesired for "O" command. Solution: Do not copy line comment leader for "O". (closes vim/vim#9426) https://github.com/vim/vim/commit/5ea5f373729589acb38ce3f3ca338e8a6d398bdc
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_textformat.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim
index 25ae208f03..5cebdef7f1 100644
--- a/src/nvim/testdir/test_textformat.vim
+++ b/src/nvim/testdir/test_textformat.vim
@@ -238,6 +238,29 @@ func Test_format_c_comment()
END
call assert_equal(expected, getline(1, '$'))
+ " Using "o" repeates the line comment, "O" does not.
+ %del
+ let text =<< trim END
+ nop;
+ val = val; // This is a comment
+ END
+ call setline(1, text)
+ normal 2Go
+ let expected =<< trim END
+ nop;
+ val = val; // This is a comment
+ //
+ END
+ call assert_equal(expected, getline(1, '$'))
+ normal 2GO
+ let expected =<< trim END
+ nop;
+
+ val = val; // This is a comment
+ //
+ END
+ call assert_equal(expected, getline(1, '$'))
+
bwipe!
endfunc