Merge pull request #1324 from rddunphy/dev

File name prompt fixes
This commit is contained in:
Tinmarino
2023-06-14 12:29:28 -04:00
committed by GitHub
3 changed files with 18 additions and 15 deletions
+10 -7
View File
@@ -394,7 +394,7 @@ function! vimwiki#base#open_link(cmd, link, ...) abort
endfunction
function! vimwiki#base#get_globlinks_escaped(...) abort
function! vimwiki#base#get_globlinks(...) abort
" Escape global link
" Called by command completion
let s_arg_lead = a:0 > 0 ? a:1 : ''
@@ -414,8 +414,6 @@ function! vimwiki#base#get_globlinks_escaped(...) abort
" " use smart case matching
let r_arg = substitute(s_arg_lead, '\u', '[\0\l\0]', 'g')
call filter(lst, '-1 != match(v:val, r_arg)')
" Apply fnameescape() to each item
call map(lst, 'fnameescape(v:val)')
" Return list (for customlist completion)
return lst
endfunction
@@ -493,7 +491,12 @@ function! vimwiki#base#goto(...) abort
" Jump: to other wikifile, specified on command mode
" Called: by command VimwikiGoto (Exported)
let key = a:0 > 0 && a:1 !=# '' ? a:1 : input('Enter name: ', '',
\ 'customlist,vimwiki#base#complete_links_escaped')
\ 'customlist,vimwiki#base#complete_links')
if key ==# ''
" Input cancelled
return
endif
let anchor = a:0 > 1 ? a:2 : ''
@@ -1106,7 +1109,7 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
" :param: anchor
" :param: (1) vimwiki_prev_link
" :param: (2) vimwiki#u#ft_is_vw()
let fname = escape(a:filename, '% *|#`')
let fname = fnameescape(a:filename)
let dir = fnamemodify(a:filename, ':p:h')
let ok = vimwiki#path#mkdir(dir, 1)
@@ -2862,9 +2865,9 @@ function! vimwiki#base#detect_nested_syntax() abort
endfunction
function! vimwiki#base#complete_links_escaped(ArgLead, CmdLine, CursorPos) abort
function! vimwiki#base#complete_links(ArgLead, CmdLine, CursorPos) abort
" Complete escaping globlinks
return vimwiki#base#get_globlinks_escaped(a:ArgLead)
return vimwiki#base#get_globlinks(a:ArgLead)
endfunction