From 164131762f1d37f7e7dc19e0ebe177c80c3f74ea Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Sun, 22 Apr 2018 10:23:16 -0400 Subject: [PATCH] Refine the internals of the "showMenu()" function --- lib/nerdtree/menu_controller.vim | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/nerdtree/menu_controller.vim b/lib/nerdtree/menu_controller.vim index f24e222..68e4d30 100644 --- a/lib/nerdtree/menu_controller.vim +++ b/lib/nerdtree/menu_controller.vim @@ -23,13 +23,14 @@ function! s:MenuController.showMenu() try let self.selection = 0 + let l:done = 0 - let done = 0 - while !done + while !l:done redraw! call self._echoPrompt() - let key = nr2char(getchar()) - let done = self._handleKeypress(key) + + let l:key = nr2char(getchar()) + let l:done = self._handleKeypress(l:key) endwhile finally call self._restoreOptions() @@ -41,8 +42,8 @@ function! s:MenuController.showMenu() endtry if self.selection != -1 - let m = self._current() - call m.execute() + let l:m = self._current() + call l:m.execute() endif endfunction