nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 92a20c0736f39aac0498db7bbf98b886dfa1ef70
parent 52151fb30741dfd3665d3e4e5493c6cc822992fc
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date:   Wed, 24 Oct 2018 22:14:18 -0400

Bug fix: Parse . and .. from path string with trailing slash. (#899)


Diffstat:
Mlib/nerdtree/tree_dir_node.vim | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -304,9 +304,11 @@ function! s:TreeDirNode._glob(pattern, all)
         for l:file in l:globList
             let l:tail = fnamemodify(l:file, ':t')
 
-            " Double the modifier if only a separator was stripped.
+            " If l:file has a trailing slash, then its :tail will be ''. Use
+            " :h to drop the slash and the empty string after it; then use :t
+            " to get the directory name.
             if l:tail == ''
-                let l:tail = fnamemodify(l:file, ':t:t')
+                let l:tail = fnamemodify(l:file, ':h:t')
             endif
 
             if l:tail == '.' || l:tail == '..'