Use :mode only in neovim. MacVim still needs to use :redraw! (#1019)

* Use :mode only in neovim. MacVim still needs to use :redraw!

* Make nerdtree#redraw do both redraw and redraw! based on a parameter.

* Make bang a required parameter.

* Replace all redraw statments with call nerdtree#redraw function calls.

* Update version in change log.
This commit is contained in:
Phil Runninger
2019-07-10 09:45:58 -04:00
committed by GitHub
parent 2f0d48d632
commit 4ac07f52a3
5 changed files with 29 additions and 12 deletions

View File

@@ -22,8 +22,24 @@ endfunction
" SECTION: General Functions {{{1
"============================================================
function! nerdtree#slash()
"FUNCTION: nerdtree#redraw(bang)
" Redraws the screen (Neovim uses the mode statement). If bang is TRUE, use
" redraw! instead of redraw.
function! nerdtree#redraw(bang)
if has('nvim')
mode
else
if a:bang
redraw!
else
redraw
endif
endif
endfunction
"FUNCTION: nerdtree#slash()
" Returns the directory separator based on OS and &shellslash
function! nerdtree#slash()
if nerdtree#runningWindows()
if exists('+shellslash') && &shellslash
return '/'
@@ -216,7 +232,7 @@ endfunction
"Args:
"msg: the message to echo
function! nerdtree#echo(msg)
redraw
call nerdtree#redraw(0)
echomsg empty(a:msg) ? "" : ("NERDTree: " . a:msg)
endfunction