Fix relative paths for VimwikiRenameLink. Merge PR #787.
Fixes #90 __Problem__: VimwikiRenameLink does not rename dir1/toto url in dir2/tata because the dirs (dir2 and .) were well crossed but badly inspected. __Solution__: `blob(.ext*)` -> `glob(**/*.ext)` + find the relative URL * Fasten: VimwikiRenameLink goes faster with cache More: To compute old_url regex, use a cache dict because it is the same for files in the same directories * Util DeleteHiddenBuffer -> do not delete Vader buffer * Test: Prettify: Util: teardown delete defined function * Remove unnecessary trailing spaces Note: list_VimwikiReturn.vader has some necessary trailing spaces
This commit is contained in:
@ -58,11 +58,14 @@ Before (Define functions):
|
||||
" Delete Hidden buffer, usefull to clean
|
||||
" Stole from: https://stackoverflow.com/a/8459043/2544873
|
||||
function! DeleteHiddenBuffers()
|
||||
let tpbl=[]
|
||||
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
|
||||
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
|
||||
silent execute 'bwipeout!' buf
|
||||
endfor
|
||||
let tpbl=[]
|
||||
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
|
||||
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
|
||||
if bufname(buf) =~ 'Vader'
|
||||
continue
|
||||
endif
|
||||
silent execute 'bwipeout!' buf
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Write current file: helper to hide `set bt=`
|
||||
|
@ -1,3 +1,6 @@
|
||||
After (Cleanup):
|
||||
delfunction SetSyntax
|
||||
delfunction ReloadVimwiki
|
||||
delfunction DeleteHiddenBuffers
|
||||
delfunction WriteMe
|
||||
delfunction PrintCommand
|
||||
|
Reference in New Issue
Block a user