mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3475: expression register set by not executed put command (#17211)
This commit is contained in:
parent
a28a9aec63
commit
58d01d3403
@ -1758,7 +1758,9 @@ static char_u *do_one_cmd(char_u **cmdlinep, int flags, cstack_T *cstack, LineGe
|
||||
ea.regname = *ea.arg++;
|
||||
// for '=' register: accept the rest of the line as an expression
|
||||
if (ea.arg[-1] == '=' && ea.arg[0] != NUL) {
|
||||
set_expr_line(vim_strsave(ea.arg));
|
||||
if (!ea.skip) {
|
||||
set_expr_line(vim_strsave(ea.arg));
|
||||
}
|
||||
ea.arg += STRLEN(ea.arg);
|
||||
}
|
||||
ea.arg = skipwhite(ea.arg);
|
||||
|
@ -400,3 +400,13 @@ func Test_winsize_cmd()
|
||||
call assert_fails('win_getid(1)', 'E475: Invalid argument: _getid(1)')
|
||||
" Actually changing the window size would be flaky.
|
||||
endfunc
|
||||
|
||||
func Test_not_break_expression_register()
|
||||
call setreg('=', '1+1')
|
||||
if 0
|
||||
put =1
|
||||
endif
|
||||
call assert_equal('1+1', getreg('=', 1))
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Loading…
Reference in New Issue
Block a user