mirror of
https://github.com/preservim/nerdtree.git
synced 2025-02-01 01:47:14 +08:00
simplify the menu rendering
now we have a slight flicker on console vim, but the rendering engine is more robust in general and should work across different OSs/versions of vim
This commit is contained in:
parent
0dda0ce5d7
commit
38e2bcaf85
|
@ -486,7 +486,7 @@ function! s:MenuController.showMenu()
|
|||
|
||||
let done = 0
|
||||
while !done
|
||||
call self._redraw()
|
||||
redraw!
|
||||
echo self._prompt()
|
||||
let key = nr2char(getchar())
|
||||
let done = self._handleKeypress(key)
|
||||
|
@ -586,26 +586,10 @@ function! s:MenuController._nextIndexFor(shortcut)
|
|||
return -1
|
||||
endfunction
|
||||
|
||||
"FUNCTION: MenuController._redraw() {{{3
|
||||
"wrapper for :redraw[!]. Exists mainly to encapsulate a hack where gtk2 gvim
|
||||
"doesnt redraw properly without the !
|
||||
function! s:MenuController._redraw()
|
||||
if has("gui_running")
|
||||
redraw!
|
||||
else
|
||||
redraw
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: MenuController._setCmdheight() {{{3
|
||||
"sets &cmdheight to whatever is needed to display the menu. The gtk2 gvim
|
||||
"spazzes out if we dont have an extra line
|
||||
"sets &cmdheight to whatever is needed to display the menu
|
||||
function! s:MenuController._setCmdheight()
|
||||
if has("gui_running")
|
||||
let &cmdheight = len(self.menuItems) + 3
|
||||
else
|
||||
let &cmdheight = len(self.menuItems) + 2
|
||||
endif
|
||||
let &cmdheight = len(self.menuItems) + 3
|
||||
endfunction
|
||||
|
||||
"FUNCTION: MenuController._saveOptions() {{{3
|
||||
|
|
Loading…
Reference in New Issue
Block a user