0
@@ -221,25 +221,29 @@ function! s:oBookmark.CacheBookmarks(silent) dict
0
let bookmarkStrings = readfile(g:NERDTreeBookmarksFile)
0
let invalidBookmarksFound = 0
0
for i in bookmarkStrings
0
- let name = substitute(i, '^\(.\{-}\) .*$', '\1', '')
0
- let path = substitute(i, '^.\{-} \(.*\)$', '\1', '')
0
- let bookmark = s:oBookmark.New(name, s:oPath.New(path))
0
- call add(g:NERDTreeBookmarks, bookmark)
0
- catch /NERDTree.Path.InvalidArguments/
0
- call add(g:NERDTreeInvalidBookmarks, i)
0
- let invalidBookmarksFound += 1
0
+ let name = substitute(i, '^\(.\{-}\) .*$', '\1', '')
0
+ let path = substitute(i, '^.\{-} \(.*\)$', '\1', '')
0
+ let bookmark = s:oBookmark.New(name, s:oPath.New(path))
0
+ call add(g:NERDTreeBookmarks, bookmark)
0
+ catch /NERDTree.Path.InvalidArguments/
0
+ call add(g:NERDTreeInvalidBookmarks, i)
0
+ let invalidBookmarksFound += 1
0
if invalidBookmarksFound
0
call s:oBookmark.Write()
0
- call s:Echo(invalidBookmarksFound .
0
- \ " invalid bookmarks were read. They have been moved to the bottom of ".
0
- \ g:NERDTreeBookmarksFile. " please edit or remove them.")
0
+ call s:Echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.")
0
+ call s:oBookmark.Sort()
0
" FUNCTION: oBookmark.CompareTo(otherbookmark) {{{3
0
@@ -352,6 +356,10 @@ function! s:oBookmark.Write() dict
0
for i in s:oBookmark.Bookmarks()
0
call add(bookmarkStrings, i.name . ' ' . i.path.StrForOS(0))
0
+ "add a blank line before the invalid ones
0
+ call add(bookmarkStrings, "")
0
for j in s:oBookmark.InvalidBookmarks()
0
call add(bookmarkStrings, j)
0
@@ -2809,8 +2817,7 @@ function! s:ValidateBookmark(bookmark)
0
catch /NERDTree.BookmarkPointsToInvalidLocation/
0
- echo a:bookmark.name . " now points to an invalid location. It has been moved to the bottom of ".
0
- \ g:NERDTreeBookmarksFile . " please edit or remove it"
0
+ call s:Echo(a:bookmark.name . "now points to an invalid location. See :help NERDTreeInvalidBookmarks for info.")
Comments
No one has commented yet.