mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Merge pull request #488 from hiberabyss/master
issue #147: add support to ~ expand in bookmarks
This commit is contained in:
@@ -87,6 +87,7 @@ function! s:Bookmark.CacheBookmarks(silent)
|
|||||||
|
|
||||||
let name = substitute(i, '^\(.\{-}\) .*$', '\1', '')
|
let name = substitute(i, '^\(.\{-}\) .*$', '\1', '')
|
||||||
let path = substitute(i, '^.\{-} \(.*\)$', '\1', '')
|
let path = substitute(i, '^.\{-} \(.*\)$', '\1', '')
|
||||||
|
let path = fnamemodify(path, ':p')
|
||||||
|
|
||||||
try
|
try
|
||||||
let bookmark = s:Bookmark.New(name, g:NERDTreePath.New(path))
|
let bookmark = s:Bookmark.New(name, g:NERDTreePath.New(path))
|
||||||
@@ -304,7 +305,7 @@ endfunction
|
|||||||
function! s:Bookmark.Write()
|
function! s:Bookmark.Write()
|
||||||
let bookmarkStrings = []
|
let bookmarkStrings = []
|
||||||
for i in s:Bookmark.Bookmarks()
|
for i in s:Bookmark.Bookmarks()
|
||||||
call add(bookmarkStrings, i.name . ' ' . i.path.str())
|
call add(bookmarkStrings, i.name . ' ' . fnamemodify(i.path.str(), ':~'))
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
"add a blank line before the invalid ones
|
"add a blank line before the invalid ones
|
||||||
|
|||||||
Reference in New Issue
Block a user