commit 75a9232fd584dc0ad8c8dedde6d7c2634f4617f2
parent 2f20c617d694b3d6987d2841402f1e6cafc16c09
Author: Tinmarino <tinmarino@gmail.com>
Date: Tue, 21 Jul 2020 10:20:06 -0400
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.
Diffstat:
3 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/Dockerfile b/Dockerfile
@@ -1,20 +1,20 @@
-FROM testbed/vim:17
+FROM testbed/vim:latest
-# add packages
-RUN apk --no-cache add bash=~5.0
-RUN apk --no-cache add git=~2.22
-RUN apk --no-cache add python3=~3.7
+# Add packages
+RUN apk --no-cache add bash
+RUN apk --no-cache add git
+RUN apk --no-cache add python3
-# get vint for linting
-RUN pip3 install vim-vint==0.3.21
+# Get vint for linting
+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
WORKDIR /vader
RUN git checkout de8a976f1eae2c2b680604205c3e8b5c8882493c
-# build vim and neovim versions we want to test
-# TODO uncomment nvim tag
+# Build vim and neovim versions we want to test
+# TODO add nvim tag
WORKDIR /
RUN install_vim -tag v7.3.429 -name vim_7.3.429 -build \
-tag v7.4.1099 -name vim_7.4.1099 -build \
diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim
@@ -455,7 +455,9 @@ endfunction
" Jump to other wikifile, specified on command mode
" Called: by command VimwikiGoto (Exported)
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 : ''
" Save current file pos
diff --git a/test/command_goto.vader b/test/command_goto.vader
@@ -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
@@ -17,7 +21,19 @@ Do (VimwikiGoto <CR> buzz_bozz && Assert):
buzz_bozz\<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
AssertEqual $HOME . '/testmarkdown/index.md', expand('%')
let s_complete=string(vimwiki#base#get_globlinks_escaped())