mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.1293: Vim9: error when using vim9script in TextYankPost
Problem: Vim9: error when using vim9script in TextYankPost. Solution: Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can be used when text is locked. (closes #6529)
This commit is contained in:
parent
2afc3b4f77
commit
2d6b20d6a9
@ -1708,6 +1708,10 @@ def Test_execute_cmd()
|
|||||||
assert_equal('execute-var-var', getline(1))
|
assert_equal('execute-var-var', getline(1))
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
|
let n = true
|
||||||
|
execute 'echomsg' (n ? '"true"' : '"no"')
|
||||||
|
assert_match('^true$', Screenline(&lines))
|
||||||
|
|
||||||
call CheckDefFailure(['execute xxx'], 'E1001:')
|
call CheckDefFailure(['execute xxx'], 'E1001:')
|
||||||
call CheckDefFailure(['execute "cmd"# comment'], 'E488:')
|
call CheckDefFailure(['execute "cmd"# comment'], 'E488:')
|
||||||
enddef
|
enddef
|
||||||
@ -2634,6 +2638,32 @@ def Test_vim9_copen()
|
|||||||
quit
|
quit
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
" test using a vim9script that is auto-loaded from an autocmd
|
||||||
|
def Test_vim9_autoload()
|
||||||
|
let lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
def foo#test()
|
||||||
|
echomsg getreg('"')
|
||||||
|
enddef
|
||||||
|
END
|
||||||
|
|
||||||
|
mkdir('Xdir/autoload', 'p')
|
||||||
|
writefile(lines, 'Xdir/autoload/foo.vim')
|
||||||
|
let save_rtp = &rtp
|
||||||
|
exe 'set rtp^=' .. getcwd() .. '/Xdir'
|
||||||
|
augroup test
|
||||||
|
autocmd TextYankPost * call foo#test()
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
normal Y
|
||||||
|
|
||||||
|
augroup test
|
||||||
|
autocmd!
|
||||||
|
augroup END
|
||||||
|
delete('Xdir', 'rf')
|
||||||
|
&rtp = save_rtp
|
||||||
|
enddef
|
||||||
|
|
||||||
" Keep this last, it messes up highlighting.
|
" Keep this last, it messes up highlighting.
|
||||||
def Test_substitute_cmd()
|
def Test_substitute_cmd()
|
||||||
new
|
new
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
1293,
|
||||||
/**/
|
/**/
|
||||||
1292,
|
1292,
|
||||||
/**/
|
/**/
|
||||||
|
@ -3755,7 +3755,9 @@ compile_subscript(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*p == '(')
|
// Do not skip over white space to find the "(", "exeucte 'x' ()" is
|
||||||
|
// not a function call.
|
||||||
|
if (**arg == '(')
|
||||||
{
|
{
|
||||||
garray_T *stack = &cctx->ctx_type_stack;
|
garray_T *stack = &cctx->ctx_type_stack;
|
||||||
type_T *type;
|
type_T *type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user