mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-25 09:41:03 +08:00
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 ‘(’
This commit is contained in:
parent
60ec10b477
commit
2eaedd8bf4
|
@ -62,9 +62,10 @@ function! s:MenuController._echoPrompt()
|
||||||
|
|
||||||
if self.isMinimal()
|
if self.isMinimal()
|
||||||
let selection = self.menuItems[self.selection].text
|
let selection = self.menuItems[self.selection].text
|
||||||
|
let keyword = matchstr(selection, "\([^ ]*")
|
||||||
|
|
||||||
let shortcuts = map(copy(self.menuItems), "v:val['shortcut']")
|
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): "
|
echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): "
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user