nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 2eaedd8bf403202eeacb363abe2de4753141b00a
parent 60ec10b477eefc81eeafafa2a8c1b00046ee48fb
Author: Chris Patuzzo <chris@patuzzo.co.uk>
Date:   Sun, 15 Sep 2019 19:41:27 +0100

Fix (p)ath not displaying in the minimal menu (#1038)

The ‘copy (p)ath to clipboard’ menu item was added
recently in this pull request:
https://github.com/scrooloose/nerdtree/pull/1002/files

However, this caused the NERDTreeMinimalMenu to
display ‘copy’ instead of ‘(p)ath’ because it was
simply using the first word of the item’s text.

This change fixes that bug by using a regex to
pick out the first word beginning with ‘(’
Diffstat:
Mlib/nerdtree/menu_controller.vim | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/nerdtree/menu_controller.vim b/lib/nerdtree/menu_controller.vim
@@ -62,9 +62,10 @@ function! s:MenuController._echoPrompt()
 
     if self.isMinimal()
         let selection = self.menuItems[self.selection].text
+        let keyword = matchstr(selection, "\([^ ]*")
 
         let shortcuts = map(copy(self.menuItems), "v:val['shortcut']")
-        let shortcuts[self.selection] = " " . split(selection)[0] . " "
+        let shortcuts[self.selection] = " " . keyword . " "
 
         echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): "
     else