You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Vim9 script, we cannot write a block in an autoload script sourced while calling an omni completion function.
To Reproduce
Run this shell command:
vim -Nu NONE -S <(cat <<'EOF'
vim9script
set rtp=/tmp/some
var dir = '/tmp/some/autoload'
mkdir(dir, 'p')
var lines =<< trim END
vim9script
def omni#func(findstart: bool, base: string): any
if findstart
return 1
else
return ['match']
endif
enddef
{
eval 1 + 2
}
END
writefile(lines, dir .. '/omni.vim')
&l:omnifunc = 'omni#func'
startinsert
feedkeys("\<C-X>\<C-O>")
EOF
)
The error E565 is given:
E565: Not allowed to change text or change window: {
Expected behavior
No error is given. match is inserted in the buffer.
Environment
Vim version: 8.2 Included patches: 1-3215
OS: Ubuntu 20.04.2 LTS
Terminal: XTerm(353)
Additional context
No issue if the block is removed:
vim9scriptsetrtp=/tmp/some
vardir='/tmp/some/autoload'mkdir(dir, 'p')
varlines=<< trim END
vim9scriptdefomni#func(findstart: bool, base: string): any
if findstart
return1elsereturn ['match']
endifenddef
END
writefile(lines, dir .. '/omni.vim')
&l:omnifunc='omni#func'startinsertfeedkeys("\<C-X>\<C-O>")
no error
No issue if the omnifunc is moved in a non-autoloaded script:
vim9scriptdefg:OmniFunc(findstart: bool, base: string): any
if findstart
return1elsereturn ['match']
endifenddef
{
eval1+2
}
&l:omnifunc='g:OmniFunc'startinsertfeedkeys("\<C-X>\<C-O>")
no error
The text was updated successfully, but these errors were encountered:
Describe the bug
In Vim9 script, we cannot write a block in an autoload script sourced while calling an omni completion function.
To Reproduce
Run this shell command:
The error
E565
is given:Expected behavior
No error is given.
match
is inserted in the buffer.Environment
Additional context
No issue if the block is removed:
No issue if the omnifunc is moved in a non-autoloaded script:
The text was updated successfully, but these errors were encountered: