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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user