Revert #1019 to fix nvim artifacts and flickering. (#1021)

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

This reverts commit 4ac07f52a3.

* If not Neovim, use `:redraw!` as was done before.

* Update version number.

* Fix punctuation in NERDTree Menu instructions.
This commit is contained in:
Phil Runninger 2019-07-14 15:17:56 -04:00 committed by GitHub
parent 4ac07f52a3
commit 63c59208c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 29 deletions

View File

@ -1,6 +1,7 @@
# Change Log # Change Log
#### 5.2... #### 5.2...
- **.8**: Revert [#1019](https://github.com/scrooloose/nerdtree/pull/1019) to fix nvim artifacts and flickering. (PhilRunninger) [#1021](https://github.com/scrooloose/nerdtree/pull/1021)
- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! [#1019](https://github.com/scrooloose/nerdtree/pull/1019) - **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. [#1017](https://github.com/scrooloose/nerdtree/pull/1017) - **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
- **.5**: Use `:mode` instead of `:redraw!` when updating menu. (PhilRunninger) [#1016](https://github.com/scrooloose/nerdtree/pull/1016) - **.5**: Use `:mode` instead of `:redraw!` when updating menu. (PhilRunninger) [#1016](https://github.com/scrooloose/nerdtree/pull/1016)

View File

@ -22,24 +22,8 @@ endfunction
" SECTION: General Functions {{{1 " SECTION: General Functions {{{1
"============================================================ "============================================================
"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() function! nerdtree#slash()
if nerdtree#runningWindows() if nerdtree#runningWindows()
if exists('+shellslash') && &shellslash if exists('+shellslash') && &shellslash
return '/' return '/'
@ -232,7 +216,7 @@ endfunction
"Args: "Args:
"msg: the message to echo "msg: the message to echo
function! nerdtree#echo(msg) function! nerdtree#echo(msg)
call nerdtree#redraw(0) redraw
echomsg empty(a:msg) ? "" : ("NERDTree: " . a:msg) echomsg empty(a:msg) ? "" : ("NERDTree: " . a:msg)
endfunction endfunction

View File

@ -254,7 +254,7 @@ function! s:deleteBookmark(bookmark)
let l:choices = "&Yes\n&No" let l:choices = "&Yes\n&No"
echo | call nerdtree#redraw(0) echo | redraw
let l:selection = confirm(l:message, l:choices, 1, 'Warning') let l:selection = confirm(l:message, l:choices, 1, 'Warning')
if l:selection != 1 if l:selection != 1
@ -266,7 +266,7 @@ function! s:deleteBookmark(bookmark)
call a:bookmark.delete() call a:bookmark.delete()
silent call b:NERDTree.root.refresh() silent call b:NERDTree.root.refresh()
call b:NERDTree.render() call b:NERDTree.render()
echo | call nerdtree#redraw(0) echo | redraw
catch /^NERDTree/ catch /^NERDTree/
call nerdtree#echoWarning('could not remove bookmark') call nerdtree#echoWarning('could not remove bookmark')
endtry endtry
@ -577,7 +577,7 @@ function! s:refreshRoot()
call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w") call nerdtree#exec(g:NERDTree.GetWinNum() . "wincmd w")
call b:NERDTree.root.refresh() call b:NERDTree.root.refresh()
call b:NERDTree.render() call b:NERDTree.render()
call nerdtree#redraw(0) redraw
call nerdtree#exec(l:curWin . "wincmd w") call nerdtree#exec(l:curWin . "wincmd w")
call nerdtree#echo("") call nerdtree#echo("")
endfunction endfunction

View File

@ -31,7 +31,11 @@ function! s:MenuController.showMenu()
let l:done = 0 let l:done = 0
while !l:done while !l:done
call nerdtree#redraw(1) if has('nvim')
mode
else
redraw!
endif
call self._echoPrompt() call self._echoPrompt()
let l:key = nr2char(getchar()) let l:key = nr2char(getchar())
@ -42,7 +46,7 @@ function! s:MenuController.showMenu()
" Redraw when "Ctrl-C" or "Esc" is received. " Redraw when "Ctrl-C" or "Esc" is received.
if !l:done || self.selection == -1 if !l:done || self.selection == -1
call nerdtree#redraw(1) redraw!
endif endif
endtry endtry
@ -64,7 +68,7 @@ function! s:MenuController._echoPrompt()
echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): " echo "Menu: [" . join(shortcuts, ",") . "] (" . navHelp . " or shortcut): "
else else
echo "NERDTree Menu. " . navHelp . " . or the shortcuts indicated" echo "NERDTree Menu. " . navHelp . ", or the shortcuts indicated"
echo "=========================================================" echo "========================================================="
for i in range(0, len(self.menuItems)-1) for i in range(0, len(self.menuItems)-1)

View File

@ -78,7 +78,7 @@ function! s:inputPrompt(action)
endif endif
if g:NERDTreeMenuController.isMinimal() if g:NERDTreeMenuController.isMinimal()
call nerdtree#redraw(1) " Clear the menu redraw! " Clear the menu
return minimal . " " return minimal . " "
else else
let divider = "==========================================================" let divider = "=========================================================="
@ -185,7 +185,7 @@ function! NERDTreeAddNode()
call newTreeNode.putCursorHere(1, 0) call newTreeNode.putCursorHere(1, 0)
endif endif
call nerdtree#redraw(1) redraw!
catch /^NERDTree/ catch /^NERDTree/
call nerdtree#echoWarning("Node Not Created.") call nerdtree#echoWarning("Node Not Created.")
endtry endtry
@ -234,7 +234,7 @@ function! NERDTreeMoveNode()
call curNode.putCursorHere(1, 0) call curNode.putCursorHere(1, 0)
call nerdtree#redraw(1) redraw!
catch /^NERDTree/ catch /^NERDTree/
call nerdtree#echoWarning("Node Not Renamed.") call nerdtree#echoWarning("Node Not Renamed.")
endtry endtry
@ -272,7 +272,7 @@ function! NERDTreeDeleteNode()
call s:promptToDelBuffer(bufnum, prompt) call s:promptToDelBuffer(bufnum, prompt)
endif endif
call nerdtree#redraw(1) redraw!
catch /^NERDTree/ catch /^NERDTree/
call nerdtree#echoWarning("Could not remove node") call nerdtree#echoWarning("Could not remove node")
endtry endtry
@ -362,7 +362,7 @@ function! NERDTreeCopyNode()
call nerdtree#echo("Copy aborted.") call nerdtree#echo("Copy aborted.")
endif endif
let &shellslash = l:shellslash let &shellslash = l:shellslash
call nerdtree#redraw(1) redraw!
endfunction endfunction
" FUNCTION: NERDTreeCopyPath() {{{1 " FUNCTION: NERDTreeCopyPath() {{{1