# HG changeset patch # User Bram Moolenaar # Date 1596383103 -7200 # Node ID c495d3e30f4b01096a5ffabe962959607e73a65a # Parent 4bc6d27d7c73715610a42e1e3135c5d570f014ce patch 8.2.1356: Vim9: cannot get the percent register Commit: https://github.com/vim/vim/commit/7226e5b19bd6e081043cbcc32541ef72bbdf667d Author: Bram Moolenaar Date: Sun Aug 2 17:33:26 2020 +0200 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 https://github.com/vim/vim/issues/6566) diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1430,6 +1430,15 @@ enddef def Test_expr7_register() @a = 'register a' assert_equal('register a', @a) + + let fname = expand('%') + assert_equal(fname, @%) + + feedkeys(":echo 'some'\", "xt") + assert_equal("echo 'some'", @:) + + normal axyz + assert_equal("xyz", @.) enddef def Test_expr7_namespace() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1356, +/**/ 1355, /**/ 1354, diff --git a/src/vim9compile.c b/src/vim9compile.c --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -3565,7 +3565,7 @@ compile_get_register(char_u **arg, cctx_ semsg(_(e_syntax_at), *arg - 1); return FAIL; } - if (!valid_yank_reg(**arg, TRUE)) + if (!valid_yank_reg(**arg, FALSE)) { emsg_invreg(**arg); return FAIL;