0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.1356: Vim9: cannot get the percent register

Problem:    Vim9: cannot get the percent register.
Solution:   Check for readable registers instead of writable. (closes #6566)
This commit is contained in:
Bram Moolenaar 2020-08-02 17:33:26 +02:00
parent c2ee44cc38
commit 7226e5b19b
3 changed files with 12 additions and 1 deletions

View File

@ -1430,6 +1430,15 @@ enddef
def Test_expr7_register() def Test_expr7_register()
@a = 'register a' @a = 'register a'
assert_equal('register a', @a) assert_equal('register a', @a)
let fname = expand('%')
assert_equal(fname, @%)
feedkeys(":echo 'some'\<CR>", "xt")
assert_equal("echo 'some'", @:)
normal axyz
assert_equal("xyz", @.)
enddef enddef
def Test_expr7_namespace() def Test_expr7_namespace()

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1356,
/**/ /**/
1355, 1355,
/**/ /**/

View File

@ -3565,7 +3565,7 @@ compile_get_register(char_u **arg, cctx_T *cctx)
semsg(_(e_syntax_at), *arg - 1); semsg(_(e_syntax_at), *arg - 1);
return FAIL; return FAIL;
} }
if (!valid_yank_reg(**arg, TRUE)) if (!valid_yank_reg(**arg, FALSE))
{ {
emsg_invreg(**arg); emsg_invreg(**arg);
return FAIL; return FAIL;