mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
vim-patch:8.2.1547: various comment problems
Problem: Various comment problems.
Solution: Update comments.
02c037a4be
This commit is contained in:
@@ -4204,7 +4204,6 @@ int put_escstr(FILE *fd, char_u *strstart, int what)
|
|||||||
{
|
{
|
||||||
char_u *str = strstart;
|
char_u *str = strstart;
|
||||||
int c;
|
int c;
|
||||||
int modifiers;
|
|
||||||
|
|
||||||
// :map xx <Nop>
|
// :map xx <Nop>
|
||||||
if (*str == NUL && what == 1) {
|
if (*str == NUL && what == 1) {
|
||||||
@@ -4231,7 +4230,7 @@ int put_escstr(FILE *fd, char_u *strstart, int what)
|
|||||||
* when they are read back.
|
* when they are read back.
|
||||||
*/
|
*/
|
||||||
if (c == K_SPECIAL && what != 2) {
|
if (c == K_SPECIAL && what != 2) {
|
||||||
modifiers = 0x0;
|
int modifiers = 0;
|
||||||
if (str[1] == KS_MODIFIER) {
|
if (str[1] == KS_MODIFIER) {
|
||||||
modifiers = str[2];
|
modifiers = str[2];
|
||||||
str += 3;
|
str += 3;
|
||||||
|
@@ -512,7 +512,7 @@ int utf_ptr2cells(const char_u *p)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
/* Need to convert to a wide character. */
|
// Need to convert to a character number.
|
||||||
if (*p >= 0x80) {
|
if (*p >= 0x80) {
|
||||||
c = utf_ptr2char(p);
|
c = utf_ptr2char(p);
|
||||||
/* An illegal byte is displayed as <xx>. */
|
/* An illegal byte is displayed as <xx>. */
|
||||||
@@ -582,7 +582,7 @@ size_t mb_string2cells_len(const char_u *str, size_t size)
|
|||||||
return clen;
|
return clen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert a UTF-8 byte sequence to a wide character
|
/// Convert a UTF-8 byte sequence to a character number.
|
||||||
///
|
///
|
||||||
/// If the sequence is illegal or truncated by a NUL then the first byte is
|
/// If the sequence is illegal or truncated by a NUL then the first byte is
|
||||||
/// returned.
|
/// returned.
|
||||||
|
@@ -22,12 +22,21 @@ endfunc
|
|||||||
|
|
||||||
func Test_put_char_block2()
|
func Test_put_char_block2()
|
||||||
new
|
new
|
||||||
let a = [ getreg('a'), getregtype('a') ]
|
|
||||||
call setreg('a', ' one ', 'v')
|
call setreg('a', ' one ', 'v')
|
||||||
call setline(1, ['Line 1', '', 'Line 3', ''])
|
call setline(1, ['Line 1', '', 'Line 3', ''])
|
||||||
" visually select the first 3 lines and put register a over it
|
" visually select the first 3 lines and put register a over it
|
||||||
exe "norm! ggl\<c-v>2j2l\"ap"
|
exe "norm! ggl\<c-v>2j2l\"ap"
|
||||||
call assert_equal(['L one 1', '', 'L one 3', ''], getline(1,4))
|
call assert_equal(['L one 1', '', 'L one 3', ''], getline(1, 4))
|
||||||
|
" clean up
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_put_lines()
|
||||||
|
new
|
||||||
|
let a = [ getreg('a'), getregtype('a') ]
|
||||||
|
call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
|
||||||
|
exe 'norm! gg"add"AddG""p'
|
||||||
|
call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1, '$'))
|
||||||
" clean up
|
" clean up
|
||||||
bw!
|
bw!
|
||||||
call setreg('a', a[0], a[1])
|
call setreg('a', a[0], a[1])
|
||||||
@@ -42,21 +51,10 @@ func Test_put_expr()
|
|||||||
exec "4norm! \"=\<cr>P"
|
exec "4norm! \"=\<cr>P"
|
||||||
norm! j0.
|
norm! j0.
|
||||||
norm! j0.
|
norm! j0.
|
||||||
call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1,'$'))
|
call assert_equal(['A1','A2','A3','4A','5A','6A'], getline(1, '$'))
|
||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_put_lines()
|
|
||||||
new
|
|
||||||
let a = [ getreg('a'), getregtype('a') ]
|
|
||||||
call setline(1, ['Line 1', 'Line2', 'Line 3', ''])
|
|
||||||
exe 'norm! gg"add"AddG""p'
|
|
||||||
call assert_equal(['Line 3', '', 'Line 1', 'Line2'], getline(1,'$'))
|
|
||||||
" clean up
|
|
||||||
bw!
|
|
||||||
call setreg('a', a[0], a[1])
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func Test_put_fails_when_nomodifiable()
|
func Test_put_fails_when_nomodifiable()
|
||||||
new
|
new
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
|
Reference in New Issue
Block a user