mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05: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:
@@ -486,7 +486,7 @@ function! s:MenuController.showMenu()
|
|||||||
|
|
||||||
let done = 0
|
let done = 0
|
||||||
while !done
|
while !done
|
||||||
call self._redraw()
|
redraw!
|
||||||
echo self._prompt()
|
echo self._prompt()
|
||||||
let key = nr2char(getchar())
|
let key = nr2char(getchar())
|
||||||
let done = self._handleKeypress(key)
|
let done = self._handleKeypress(key)
|
||||||
@@ -586,26 +586,10 @@ function! s:MenuController._nextIndexFor(shortcut)
|
|||||||
return -1
|
return -1
|
||||||
endfunction
|
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
|
"FUNCTION: MenuController._setCmdheight() {{{3
|
||||||
"sets &cmdheight to whatever is needed to display the menu. The gtk2 gvim
|
"sets &cmdheight to whatever is needed to display the menu
|
||||||
"spazzes out if we dont have an extra line
|
|
||||||
function! s:MenuController._setCmdheight()
|
function! s:MenuController._setCmdheight()
|
||||||
if has("gui_running")
|
let &cmdheight = len(self.menuItems) + 3
|
||||||
let &cmdheight = len(self.menuItems) + 3
|
|
||||||
else
|
|
||||||
let &cmdheight = len(self.menuItems) + 2
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: MenuController._saveOptions() {{{3
|
"FUNCTION: MenuController._saveOptions() {{{3
|
||||||
|
|||||||
Reference in New Issue
Block a user