Fix: #913: VimwikiGoto completion aafter <CR> [in input() prompt]

Issue #913:
        :VimwikiGoto tab completion only works when written in-line, not when called from \wn #913
        PR #785 adds completion to :VimwikiGoto, however it works only when you try to type the filename after the command, e.g.
This commit is contained in:
Tinmarino 2020-07-21 10:20:06 -04:00
parent 2f20c617d6
commit 75a9232fd5
3 changed files with 30 additions and 12 deletions

View File

@ -1,20 +1,20 @@
FROM testbed/vim:17 FROM testbed/vim:latest
# add packages # Add packages
RUN apk --no-cache add bash=~5.0 RUN apk --no-cache add bash
RUN apk --no-cache add git=~2.22 RUN apk --no-cache add git
RUN apk --no-cache add python3=~3.7 RUN apk --no-cache add python3
# get vint for linting # Get vint for linting
RUN pip3 install vim-vint==0.3.21 RUN pip3 install vim-vint
# get vader for unit tests # Get vader for unit tests
RUN git clone -n https://github.com/junegunn/vader.vim /vader RUN git clone -n https://github.com/junegunn/vader.vim /vader
WORKDIR /vader WORKDIR /vader
RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c
# build vim and neovim versions we want to test # Build vim and neovim versions we want to test
# TODO uncomment nvim tag # TODO add nvim tag
WORKDIR / WORKDIR /
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \ RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \
-tag v7.4.1099 -name vim_7.4.1099 -build \ -tag v7.4.1099 -name vim_7.4.1099 -build \

View File

@ -455,7 +455,9 @@ endfunction
" Jump to other wikifile, specified on command mode " Jump to other wikifile, specified on command mode
" Called: by command VimwikiGoto (Exported) " Called: by command VimwikiGoto (Exported)
function! vimwiki#base#goto(...) abort function! vimwiki#base#goto(...) abort
let key = a:0 > 0 ? a:1 : input('Enter name: ') let key = a:0 > 0 ? a:1 : input('Enter name: ', '',
\ 'customlist,vimwiki#base#complete_links_escaped')
let anchor = a:0 > 1 ? a:2 : '' let anchor = a:0 > 1 ? a:2 : ''
" Save current file pos " Save current file pos

View File

@ -1,3 +1,7 @@
# Note: I dont know why <Tab> is inserting a Tab.
# Well better than to insert a Chair, but it should trigger completion
# So I used C-L
Include: vader_includes/vader_setup.vader Include: vader_includes/vader_setup.vader
@ -17,7 +21,19 @@ Do (VimwikiGoto <CR> buzz_bozz && Assert):
buzz_bozz\<CR> buzz_bozz\<CR>
:AssertEqual $HOME . '/testmarkdown/buzz_bozz.md', expand('%')\<CR> :AssertEqual $HOME . '/testmarkdown/buzz_bozz.md', expand('%')\<CR>
Execute (:VimwikiGoto + Completion): Do (VimwikiGoto + Completion(cmdline) && Assert):
:VimwikiIndex 2\<CR>
:VimwikiGoto buzz_bo\<C-l>\<CR>
:AssertEqual $HOME . '/testmarkdown/buzz_bozz.md', expand('%')\<CR>
Do (VimwikiGoto <CR> buzz_bo + Completion(input()) && Assert):
:VimwikiIndex 2\<CR>
:VimwikiGoto\<CR>
buzz_bo\<C-l>\<CR>
:AssertEqual $HOME . '/testmarkdown/buzz_bozz.md', expand('%')\<CR>
Execute (:VimwikiGoto + Completion (API)):
VimwikiIndex 2 VimwikiIndex 2
AssertEqual $HOME . '/testmarkdown/index.md', expand('%') AssertEqual $HOME . '/testmarkdown/index.md', expand('%')
let s_complete=string(vimwiki#base#get_globlinks_escaped()) let s_complete=string(vimwiki#base#get_globlinks_escaped())