Skip to content

Commit 9f377de

Browse files
committed
perf(complete): don't complete after | for wikilinks
refer: #404
1 parent 19b8a0b commit 9f377de

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

autoload/wiki/complete.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ let s:completer_wikilink = {
8585
\}
8686

8787
function! s:completer_wikilink.findstart(line) dict abort " {{{2
88-
let l:cnum = match(a:line, '\[\[\zs[^\\[\]]\{-}$')
88+
let l:cnum = match(a:line, '\[\[\zs[^\\[\]|]\{-}$')
8989
if l:cnum < 0 | return -1 | endif
9090

9191
let l:base = a:line[l:cnum:]
@@ -256,3 +256,5 @@ endfunction
256256
let s:completers = map(
257257
\ filter(items(s:), 'v:val[0] =~# ''^completer_'''),
258258
\ 'v:val[1]')
259+
260+
" vim: fdm=marker

test/wiki-basic/init.vim

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
source ../init.vim
22
runtime plugin/wiki.vim
3+
4+
set completeopt=menuone,noinsert,noselect
5+
set shortmess=aoOtFcCI
6+
set noshowmode
7+
38
silent edit index.wiki

0 commit comments

Comments
 (0)