From b4b4130f3ca13464748ff8d45bcdbd1b159fed2f Mon Sep 17 00:00:00 2001 From: Eugenij <62702485+Eugenij-W@users.noreply.github.com> Date: Fri, 26 Sep 2025 13:29:45 +0600 Subject: [PATCH 1/4] perf: optimize `Path.getSortOrderIndex()` method. (#1429) * speedup: Path.getSortOrderIndex() optimisation. * refactor: remove the redundant new line --------- Co-authored-by: rzvxa <3788964+rzvxa@users.noreply.github.com> --- lib/nerdtree/path.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 915f64b3beae1ae7a12f708fc94d40fbc62e2eca Mon Sep 17 00:00:00 2001 From: inzeets <187462853+inzeets@users.noreply.github.com> Date: Fri, 26 Sep 2025 08:59:35 -0700 Subject: [PATCH 2/4] fix: emit init notifications on new and transplanted children (#1438) --- lib/nerdtree/tree_dir_node.vim | 2 ++ 1 file changed, 2 insertions(+) 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: From 0b3c1dc0fa6389b8b5d4f2e2f589c2448637bdb8 Mon Sep 17 00:00:00 2001 From: rzvxa <3788964+rzvxa@users.noreply.github.com> Date: Fri, 26 Sep 2025 19:35:22 +0330 Subject: [PATCH 3/4] fix: emit init notification on fs menu's add file (#1447) --- nerdtree_plugin/fs_menu.vim | 1 + 1 file changed, 1 insertion(+) 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 From 690d061b591525890f1471c6675bcb5bdc8cdff9 Mon Sep 17 00:00:00 2001 From: Max Coplan Date: Fri, 26 Sep 2025 09:07:39 -0700 Subject: [PATCH 4/4] chore: fix typo in README (#1439) --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.