mirror of
https://github.com/vim/vim.git
synced 2025-12-10 18:46:57 -05:00
patch 9.1.1923: wrong error when assigning to read-only register
Problem: When assigning to @. in a :let command an incorrect "E15"
error is emitted.
Solution: Emit the correct "E354" error. (Doug Kearns).
An incorrect "E488" error was also emitted in Vim9 script assignments.
It appears that the code deleted in this commit was added to work around
a limitation in the returned value from find_name_end() that no longer
exists.
See commit 76b92b2830 (tag: v7.0b).
closes: #18757
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ea86e53c2b
commit
2447131e00
@ -1088,8 +1088,6 @@ ex_let(exarg_T *eap)
|
||||
argend = skip_var_list(arg, TRUE, &var_count, &semicolon, FALSE);
|
||||
if (argend == NULL)
|
||||
return;
|
||||
if (argend > arg && argend[-1] == '.') // for var.='str'
|
||||
--argend;
|
||||
expr = skipwhite(argend);
|
||||
concat = expr[0] == '.'
|
||||
&& ((expr[1] == '=' && in_old_script(2))
|
||||
|
||||
@ -1260,4 +1260,11 @@ func Test_insert_small_delete_linewise()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_writing_readonly_regs()
|
||||
call assert_fails('let @. = "foo"', 'E354:')
|
||||
call assert_fails('let @% = "foo"', 'E354:')
|
||||
call assert_fails('let @: = "foo"', 'E354:')
|
||||
call assert_fails('let @~ = "foo"', 'E354:')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@ -3352,7 +3352,7 @@ def Test_expr9_register()
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
|
||||
v9.CheckDefAndScriptFailure(["@. = 'yes'"], ['E354:', 'E488:'], 1)
|
||||
v9.CheckDefAndScriptFailure(["@. = 'yes'"], 'E354:', 1)
|
||||
enddef
|
||||
|
||||
" This is slow when run under valgrind.
|
||||
|
||||
@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1923,
|
||||
/**/
|
||||
1922,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user