Skip to content

Commit

Permalink
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Browse files Browse the repository at this point in the history
Problem:    "o" and "O" copying comment not sufficiently tested.
Solution:   Add a test case. (closes #9718)
  • Loading branch information
zeertzjq authored and brammool committed Feb 8, 2022
1 parent 3908ef5 commit 51ab7c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/testdir/test_textformat.vim
Expand Up @@ -238,7 +238,33 @@ func Test_format_c_comment()
END
call assert_equal(expected, getline(1, '$'))

" Using "o" repeats the line comment, "O" does not.
" Using either "o" or "O" repeats a line comment occupying a whole line.
%del
let text =<< trim END
nop;
// This is a comment
val = val;
END
call setline(1, text)
normal 2Go
let expected =<< trim END
nop;
// This is a comment
//
val = val;
END
call assert_equal(expected, getline(1, '$'))
normal 2GO
let expected =<< trim END
nop;
//
// This is a comment
//
val = val;
END
call assert_equal(expected, getline(1, '$'))

" Using "o" repeats a line comment after a statement, "O" does not.
%del
let text =<< trim END
nop;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -746,6 +746,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4326,
/**/
4325,
/**/
Expand Down

0 comments on commit 51ab7c7

Please sign in to comment.