1
0
forked from aniani/vim

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'.
This commit is contained in:
Bram Moolenaar
2022-05-07 15:43:52 +01:00
parent 2bf875f881
commit 48a8a83303
3 changed files with 35 additions and 1 deletions

View File

@@ -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.\<Esc>"
let expected =<< trim END
{
val = val; // This is a comment
// blah more text
// blah.
END
call assert_equal(expected, getline(1, '$'))
bwipe!
endfunc