Rename rename_link -> rename_file (corresponding to the exported RenameFile)
This commit is contained in:
@@ -1270,7 +1270,7 @@ function! s:update_wiki_links(wiki_nr, dir, old_url, new_url) abort
|
|||||||
" Update link for all files in dir
|
" Update link for all files in dir
|
||||||
" Param: old_url, new_url: path of the old, new url relative to ...
|
" Param: old_url, new_url: path of the old, new url relative to ...
|
||||||
" Param: dir: directory of the files, relative to wiki_root
|
" Param: dir: directory of the files, relative to wiki_root
|
||||||
" Called: rename_link
|
" Called: rename_file
|
||||||
" Get list of wiki files
|
" Get list of wiki files
|
||||||
let wiki_root = vimwiki#vars#get_wikilocal('path', a:wiki_nr)
|
let wiki_root = vimwiki#vars#get_wikilocal('path', a:wiki_nr)
|
||||||
let fsources = vimwiki#base#find_files(a:wiki_nr, 0)
|
let fsources = vimwiki#base#find_files(a:wiki_nr, 0)
|
||||||
@@ -1347,7 +1347,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:get_wiki_buffers() abort
|
function! s:get_wiki_buffers() abort
|
||||||
" Get list of currently open buffer that are wiki files
|
" Get list of currently open buffer that are wiki files
|
||||||
" Called: by rename_link
|
" Called: by rename_file
|
||||||
let blist = []
|
let blist = []
|
||||||
let bcount = 1
|
let bcount = 1
|
||||||
while bcount<=bufnr('$')
|
while bcount<=bufnr('$')
|
||||||
@@ -1368,7 +1368,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:open_wiki_buffer(item) abort
|
function! s:open_wiki_buffer(item) abort
|
||||||
" Edit wiki file.
|
" Edit wiki file.
|
||||||
" Called: by rename_link: Usefull for buffer commands
|
" Called: by rename_file: Usefull for buffer commands
|
||||||
call vimwiki#base#edit_file(':e', a:item[0], '')
|
call vimwiki#base#edit_file(':e', a:item[0], '')
|
||||||
if !empty(a:item[1])
|
if !empty(a:item[1])
|
||||||
call vimwiki#vars#set_bufferlocal('prev_links', a:item[1], a:item[0])
|
call vimwiki#vars#set_bufferlocal('prev_links', a:item[1], a:item[0])
|
||||||
@@ -1770,10 +1770,10 @@ function! vimwiki#base#delete_link() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:input_rename_link() abort
|
function! s:input_rename_file() abort
|
||||||
" Ask user for a new filepath
|
" Ask user for a new filepath
|
||||||
" Returns: '' if fails
|
" Returns: '' if fails
|
||||||
" Called: rename_link
|
" Called: rename_file
|
||||||
" Ask confirmation
|
" Ask confirmation
|
||||||
let val = input('Rename "'.expand('%:t:r').'" [y]es/[N]o? ')
|
let val = input('Rename "'.expand('%:t:r').'" [y]es/[N]o? ')
|
||||||
if val !~? '^y'
|
if val !~? '^y'
|
||||||
@@ -1803,7 +1803,7 @@ function! s:input_rename_link() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! vimwiki#base#rename_link(...) abort
|
function! vimwiki#base#rename_file(...) abort
|
||||||
" Rename current file, update all links to it
|
" Rename current file, update all links to it
|
||||||
" Param: [new_filepath <string>]
|
" Param: [new_filepath <string>]
|
||||||
" Exported: VimwikiRenameFile
|
" Exported: VimwikiRenameFile
|
||||||
@@ -1822,7 +1822,7 @@ function! vimwiki#base#rename_link(...) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Read new_link <- command line || input()
|
" Read new_link <- command line || input()
|
||||||
let new_link = a:0 > 0 ? a:1 : s:input_rename_link()
|
let new_link = a:0 > 0 ? a:1 : s:input_rename_file()
|
||||||
if new_link ==# '' | return | endif
|
if new_link ==# '' | return | endif
|
||||||
|
|
||||||
let new_link = subdir.new_link
|
let new_link = subdir.new_link
|
||||||
@@ -2794,7 +2794,7 @@ endfunction
|
|||||||
|
|
||||||
function! vimwiki#base#complete_file(ArgLead, CmdLine, CursorPos) abort
|
function! vimwiki#base#complete_file(ArgLead, CmdLine, CursorPos) abort
|
||||||
" Complete filename relatie to current file
|
" Complete filename relatie to current file
|
||||||
" Called: rename_link
|
" Called: rename_file
|
||||||
" Start from current file
|
" Start from current file
|
||||||
let base_path = expand('%:h')
|
let base_path = expand('%:h')
|
||||||
|
|
||||||
|
|||||||
@@ -298,10 +298,10 @@ command! -buffer VimwikiDeleteLink
|
|||||||
\ call vimwiki#u#deprecate("VimwikiDeleteLink", "VimwikiDeleteFile") |
|
\ call vimwiki#u#deprecate("VimwikiDeleteLink", "VimwikiDeleteFile") |
|
||||||
\ call vimwiki#base#delete_link()
|
\ call vimwiki#base#delete_link()
|
||||||
command! -buffer -nargs=? -complete=customlist,vimwiki#base#complete_file
|
command! -buffer -nargs=? -complete=customlist,vimwiki#base#complete_file
|
||||||
\ VimwikiRenameFile call vimwiki#base#rename_link(<f-args>)
|
\ VimwikiRenameFile call vimwiki#base#rename_file(<f-args>)
|
||||||
command! -buffer VimwikiRenameLink
|
command! -buffer VimwikiRenameLink
|
||||||
\ call vimwiki#u#deprecate("VimwikiRenameLink", "VimwikiRenameFile") |
|
\ call vimwiki#u#deprecate("VimwikiRenameLink", "VimwikiRenameFile") |
|
||||||
\ call vimwiki#base#rename_link()
|
\ call vimwiki#base#rename_file()
|
||||||
command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit', 0, 1)
|
command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit', 0, 1)
|
||||||
command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link()
|
command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link()
|
||||||
command! -buffer -nargs=* VimwikiSplitLink call vimwiki#base#follow_link('hsplit', <f-args>)
|
command! -buffer -nargs=* VimwikiSplitLink call vimwiki#base#follow_link('hsplit', <f-args>)
|
||||||
|
|||||||
Reference in New Issue
Block a user