diff --git a/README.markdown b/README.markdown index 93a844a5..1ab47fe6 100644 --- a/README.markdown +++ b/README.markdown @@ -87,7 +87,7 @@ After installing NERDTree, the best way to learn it is to turn on the Quick Help NERDTree can be extended with custom mappings and functions using its built-in API. The details of this API are described in the included documentation. Several plugins have been written, and are available on Github for installation like any other plugin. The plugins in this list are maintained (or not) by their respective owners, and certain combinations may be incompatible. * [Xuyuanp/nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin): Shows Git status flags for files and folders in NERDTree. -* [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons): Adds filetype-specific icons to NERDTree files and folders, +* [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons): Adds filetype-specific icons to NERDTree files and folders. * [tiagofumo/vim-nerdtree-syntax-highlight](https://github.com/tiagofumo/vim-nerdtree-syntax-highlight): Adds syntax highlighting to NERDTree based on filetype. * [scrooloose/nerdtree-project-plugin](https://github.com/scrooloose/nerdtree-project-plugin): Saves and restores the state of the NERDTree between sessions. * [PhilRunninger/nerdtree-buffer-ops](https://github.com/PhilRunninger/nerdtree-buffer-ops): 1) Highlights open files in a different color. 2) Closes a buffer directly from NERDTree. diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index e0c1d954..fa6f59dd 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -362,9 +362,10 @@ endfunction " returns the index of the pattern in g:NERDTreeSortOrder that this path matches function! s:Path.getSortOrderIndex() let i = 0 + let l:lpc = self.getLastPathComponent(1) while i < len(g:NERDTreeSortOrder) if g:NERDTreeSortOrder[i] !~? '\[\[-\?\(timestamp\|size\|extension\)\]\]' && - \ self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i] + \ l:lpc =~# g:NERDTreeSortOrder[i] return i endif let i = i + 1 diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim index 3fb38331..5c25c809 100644 --- a/lib/nerdtree/tree_dir_node.vim +++ b/lib/nerdtree/tree_dir_node.vim @@ -591,6 +591,7 @@ function! s:TreeDirNode.refresh() let newNode = g:NERDTreeFileNode.New(path, self.getNerdtree()) let newNode.parent = self call add(newChildNodes, newNode) + call g:NERDTreePathNotifier.NotifyListeners('init', newNode.path, newNode.getNerdtree(), {}) endif catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/ let invalidFilesFound += 1 @@ -715,6 +716,7 @@ function! s:TreeDirNode.transplantChild(newNode) break endif endfor + call self.refresh() endfunction " vim: set sw=4 sts=4 et fdm=marker: diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim index 45126dde..dfba62a8 100644 --- a/nerdtree_plugin/fs_menu.vim +++ b/nerdtree_plugin/fs_menu.vim @@ -211,6 +211,7 @@ function! NERDTreeAddNode() call b:NERDTree.render() elseif parentNode.isOpen || !empty(parentNode.children) call parentNode.addChild(newTreeNode, 1) + call g:NERDTreePathNotifier.NotifyListeners('init', newTreeNode.path, newTreeNode.getNerdtree(), {}) call NERDTreeRender() call newTreeNode.putCursorHere(1, 0) endif