Removed unused functions; added a few more comments
This commit is contained in:
parent
6b9edefecc
commit
f47f3c4e26
@ -560,8 +560,8 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{
|
|||||||
endif
|
endif
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
" vimwiki#base#get_globlinks
|
" vimwiki#base#get_globlinks_escaped
|
||||||
function! vimwiki#base#get_globlinks() abort "{{{only get links from the current dir
|
function! vimwiki#base#get_globlinks_escaped() abort "{{{only get links from the current dir
|
||||||
" change to the directory of the current file
|
" change to the directory of the current file
|
||||||
let orig_pwd = getcwd()
|
let orig_pwd = getcwd()
|
||||||
lcd! %:h
|
lcd! %:h
|
||||||
@ -571,16 +571,13 @@ function! vimwiki#base#get_globlinks() abort "{{{only get links from the current
|
|||||||
let globlinks = substitute(globlinks, '\'.VimwikiGet('ext').'\ze\n', '', 'g')
|
let globlinks = substitute(globlinks, '\'.VimwikiGet('ext').'\ze\n', '', 'g')
|
||||||
" restore the original working directory
|
" restore the original working directory
|
||||||
exe 'lcd! '.orig_pwd
|
exe 'lcd! '.orig_pwd
|
||||||
" return all links as a single newline-separated string
|
" convert to a List
|
||||||
return globlinks
|
|
||||||
endfunction " }}}
|
|
||||||
|
|
||||||
" vimwiki#base#get_globlinks_escaped
|
|
||||||
function! vimwiki#base#get_globlinks_escaped() abort "{{{only get links from the current dir
|
|
||||||
let globlinks = vimwiki#base#get_globlinks()
|
|
||||||
let lst = split(globlinks, '\n')
|
let lst = split(globlinks, '\n')
|
||||||
|
" Apply fnameescape() to each item
|
||||||
call map(lst, 'fnameescape(v:val)')
|
call map(lst, 'fnameescape(v:val)')
|
||||||
|
" Convert back to newline-separated list
|
||||||
let globlinks = join(lst, "\n")
|
let globlinks = join(lst, "\n")
|
||||||
|
" return all escaped links as a single newline-separated string
|
||||||
return globlinks
|
return globlinks
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
@ -1815,13 +1812,6 @@ endfunction "}}}
|
|||||||
|
|
||||||
" Command completion functions {{{
|
" Command completion functions {{{
|
||||||
|
|
||||||
" vimwiki#base#complete_links
|
|
||||||
function! vimwiki#base#complete_links(ArgLead, CmdLine, CursorPos) abort " {{{
|
|
||||||
" We can safely ignore args if we use -custom=complete option, Vim engine
|
|
||||||
" will do the job of filtering.
|
|
||||||
return vimwiki#base#get_globlinks()
|
|
||||||
endfunction " }}}
|
|
||||||
|
|
||||||
" vimwiki#base#complete_links_escaped
|
" vimwiki#base#complete_links_escaped
|
||||||
function! vimwiki#base#complete_links_escaped(ArgLead, CmdLine, CursorPos) abort " {{{
|
function! vimwiki#base#complete_links_escaped(ArgLead, CmdLine, CursorPos) abort " {{{
|
||||||
" We can safely ignore args if we use -custom=complete option, Vim engine
|
" We can safely ignore args if we use -custom=complete option, Vim engine
|
||||||
|
Loading…
Reference in New Issue
Block a user