Refine the internals of the "showMenu()" function
This commit is contained in:
parent
38d4d2288a
commit
164131762f
@ -23,13 +23,14 @@ function! s:MenuController.showMenu()
|
|||||||
|
|
||||||
try
|
try
|
||||||
let self.selection = 0
|
let self.selection = 0
|
||||||
|
let l:done = 0
|
||||||
|
|
||||||
let done = 0
|
while !l:done
|
||||||
while !done
|
|
||||||
redraw!
|
redraw!
|
||||||
call self._echoPrompt()
|
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
|
endwhile
|
||||||
finally
|
finally
|
||||||
call self._restoreOptions()
|
call self._restoreOptions()
|
||||||
@ -41,8 +42,8 @@ function! s:MenuController.showMenu()
|
|||||||
endtry
|
endtry
|
||||||
|
|
||||||
if self.selection != -1
|
if self.selection != -1
|
||||||
let m = self._current()
|
let l:m = self._current()
|
||||||
call m.execute()
|
call l:m.execute()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user