patch 8.2.4908: no text formatting for // comment after a statement
Problem: No text formatting for // comment after a statement.
Solution: format a comment when the 'c' flag is in 'formatoptions'.
diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim
index 79e282e..9630e8d 100644
--- a/src/testdir/test_textformat.vim
+++ b/src/testdir/test_textformat.vim
@@ -342,6 +342,18 @@
END
call assert_equal(expected, getline(1, '$'))
+ " typing comment text auto-wraps
+ %del
+ call setline(1, text)
+ exe "normal! 2GA blah more text blah.\<Esc>"
+ let expected =<< trim END
+ {
+ val = val; // This is a comment
+ // blah more text
+ // blah.
+ END
+ call assert_equal(expected, getline(1, '$'))
+
bwipe!
endfunc