diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim index 8bd95fe..ad8c3d1 100644 --- a/lib/nerdtree/bookmark.vim +++ b/lib/nerdtree/bookmark.vim @@ -19,9 +19,6 @@ function! s:Bookmark.AddBookmark(name, path) endif endfor call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path)) - if g:NERDTreeBookmarksSort == 1 || g:NERDTreeBookmarksSort == 2 - call s:Bookmark.SortBookmarksList() - endif endfunction " FUNCTION: Bookmark.Bookmarks() {{{1 @@ -104,9 +101,6 @@ function! s:Bookmark.CacheBookmarks(silent) call nerdtree#echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.") endif endif - if g:NERDTreeBookmarksSort == 1 || g:NERDTreeBookmarksSort == 2 - call s:Bookmark.SortBookmarksList() - endif endif endfunction diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index 65ebfd9..e169dbb 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -313,6 +313,10 @@ function! s:UI._renderBookmarks() call cursor(line(".")+1, col(".")) endif + if g:NERDTreeBookmarksSort == 1 || g:NERDTreeBookmarksSort == 2 + call g:NERDTreeBookmark.SortBookmarksList() + endif + for i in g:NERDTreeBookmark.Bookmarks() call setline(line(".")+1, i.str()) call cursor(line(".")+1, col("."))