-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing key case, add BC type checking #1206
Fix missing key case, add BC type checking #1206
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works. I just have 3 BC suggestions. Fix those, and I'll merge.
autoload/nerdtree/ui_glue.vim
Outdated
|
||
if v:false is# s:validateType(l:customOpenArgs, v:t_dict) | ||
if v:false is# s:validateType(l:customOpenArgs, type({})) || empty(l:customOpenArgs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if anyone still uses it, but NERDTree is supposed to be compatible to 7.3. After reviewing (the 7.3 documentation](http://vimdoc.sourceforge.net/htmldoc/eval.html#expression-syntax), I think is#
and v:false
didn't exist at that time. Let's use this instead.
if v:false is# s:validateType(l:customOpenArgs, type({})) || empty(l:customOpenArgs) | |
if !s:validateType(l:customOpenArgs, type({})) || empty(l:customOpenArgs) |
autoload/nerdtree/ui_glue.vim
Outdated
return l:defaultOpenArgs | ||
endif | ||
|
||
for l:typeKey in keys(l:defaultOpenArgs) | ||
if v:false is# s:validateType(get(l:customOpenArgs, l:typeKey, {}), v:t_dict) | ||
if v:false is# s:validateType(get(l:customOpenArgs, l:typeKey, {}), type({})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
if v:false is# s:validateType(get(l:customOpenArgs, l:typeKey, {}), type({})) | |
if !s:validateType(get(l:customOpenArgs, l:typeKey, {}), type({})) |
And below...
function! s:validateType(variable, type) abort
return type(a:variable) == a:type
endfunction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this.
Resolves #1205