Restore the default behavior of the <CR> key. (#1221)

* Restore <CR>'s default behavior to be the same as o's.

* Remove the dictionary validation, and simplify initCustomOpenArgs().

There was a bug in the validation logic that caused a valid integer
value of 'keepopen' to always be overwritten with the defaultOpenArgs'
value. It was always comparing its type to the type of a string.

I fixed this by removing all the type validation, and wrapping the code
with a try-catch block. If NERDTreeCustomOpenArgs is not a dictionary,
an error message will print and the defaults will be used instead.

* Add fold markers to new functions.

* Update version number in change log.
This commit is contained in:
Phil Runninger
2021-02-10 22:20:04 -05:00
committed by GitHub
parent d3f9fc44ca
commit 3a9d533f3d
3 changed files with 13 additions and 36 deletions

View File

@@ -30,12 +30,12 @@ endfunction
" SECTION: General Functions {{{1
"============================================================
" FUNCTION: nerdtree#closeTreeOnOpen()
" FUNCTION: nerdtree#closeTreeOnOpen() {{{2
function! nerdtree#closeTreeOnOpen() abort
return g:NERDTreeQuitOnOpen == 1 || g:NERDTreeQuitOnOpen == 3
endfunction
" FUNCTION: nerdtree#closeBookmarksOnOpen()
" FUNCTION: nerdtree#closeBookmarksOnOpen() {{{2
function! nerdtree#closeBookmarksOnOpen() abort
return g:NERDTreeQuitOnOpen == 2 || g:NERDTreeQuitOnOpen == 3
endfunction