Skip to content

Commit

Permalink
patch 8.2.3223: Vim: using {} block in autoloade omnifunc fails
Browse files Browse the repository at this point in the history
Problem:    Vim: using {} block in autoloade omnifunc fails.
Solution:   Allow using {} block when text is locked. (closes #8631)
  • Loading branch information
brammool committed Jul 25, 2021
1 parent 3c77b6a commit ff34bee
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ex_cmds.h
Expand Up @@ -1853,7 +1853,7 @@ EXCMD(CMD_at, "@", ex_at,
EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_NONWHITE_OK,
ADDR_LINES),
EXCMD(CMD_block, "{", ex_block, // not found normally
EX_TRLBAR,
EX_TRLBAR|EX_LOCK_OK,
ADDR_NONE),
EXCMD(CMD_endblock, "}", ex_endblock,
EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
Expand Down
31 changes: 31 additions & 0 deletions src/testdir/test_ins_complete.vim
Expand Up @@ -121,6 +121,37 @@ func Test_omni_dash()
set omnifunc=
endfunc

func Test_omni_autoload()
let save_rtp = &rtp
set rtp=Xruntime/some
let dir = 'Xruntime/some/autoload'
call mkdir(dir, 'p')

let 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
call writefile(lines, dir .. '/omni.vim')

new
setlocal omnifunc=omni#func
call feedkeys("i\<C-X>\<C-O>\<Esc>", 'xt')

bwipe!
call delete('Xruntime', 'rf')
set omnifunc=
let &rtp = save_rtp
endfunc

func Test_completefunc_args()
let s:args = []
func! CompleteFunc(findstart, base)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -755,6 +755,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3223,
/**/
3222,
/**/
Expand Down

0 comments on commit ff34bee

Please sign in to comment.