From d3becd11492343761a13419abc43720aa19425af Mon Sep 17 00:00:00 2001 From: Daniel E <73450961+gladiator@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:48:36 -0700 Subject: [PATCH] Removed directory separator from sort key (#1219) * Removed directory separator from sort key Directories had an additional separator appended to them which caused improper comparisons for other directories that shared similar prefixes. * Updated changelog --- CHANGELOG.md | 1 + lib/nerdtree/path.vim | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 409d631..1472c44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) --> #### 6.10 +- **.4**: Removed directory separator from sort key (Daniel E) [#1219](https://github.com/preservim/nerdtree/pull/1219) - **.3**: Add new FAQ and answer: How to prevent buffers replacing NERDTree. (PhilRunninger) [#1215](https://github.com/preservim/nerdtree/pull/1215) - **.2**: New menu command: Run a system command in this directory. (PhilRunninger) [#1214](https://github.com/preservim/nerdtree/pull/1214) - **.1**: Escape quotation marks so they can be used in key mappings. (PhilRunninger) [#1213](https://github.com/preservim/nerdtree/pull/1213) diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index 26749c6..eec4f33 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -394,7 +394,7 @@ function! s:Path.getSortKey() let self._sortKey = [self.getSortOrderIndex()] + metadata endif - let path = self.getLastPathComponent(1) + let path = self.getLastPathComponent(0) if !g:NERDTreeSortHiddenFirst let path = substitute(path, '^[._]', '', '') endif