From 1b1cc4d864b4b15e705c1a500e64c7bfbacedae7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 May 2022 07:51:12 +0800 Subject: vim-patch:8.2.4908: no text formatting for // comment after a statement (#18472) Problem: No text formatting for // comment after a statement. Solution: format a comment when the 'c' flag is in 'formatoptions'. https://github.com/vim/vim/commit/48a8a833033e10fc1eba96f2fc8dd19c2408eddf --- src/nvim/testdir/test_textformat.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir/test_textformat.vim') diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim index 714539d418..92705cb69f 100644 --- a/src/nvim/testdir/test_textformat.vim +++ b/src/nvim/testdir/test_textformat.vim @@ -342,6 +342,18 @@ func Test_format_c_comment() END call assert_equal(expected, getline(1, '$')) + " typing comment text auto-wraps + %del + call setline(1, text) + exe "normal! 2GA blah more text blah.\" + let expected =<< trim END + { + val = val; // This is a comment + // blah more text + // blah. + END + call assert_equal(expected, getline(1, '$')) + bwipe! endfunc -- cgit