Prevent sticky type checking (E706) errors with older Vims (#681)

Vim used to throw the E706 error if you tried to change a variable's
type. This error can be triggered by vimwiki if, during the user
settings loop in `read_global_settings_from_user()`, the variable type
for `users_value` changes.

The vim error was removed in v7.4.1546 as part of
f6f32c38bf.
This commit is contained in:
Jonny Bylsma 2019-04-26 13:06:09 -04:00 committed by Rane Brown
parent 6787e0fb7e
commit e84dcbfa25
2 changed files with 4 additions and 0 deletions

View File

@ -203,6 +203,8 @@ function! s:read_global_settings_from_user()
call s:check_users_value(key, users_value, value_infos, 1) call s:check_users_value(key, users_value, value_infos, 1)
let g:vimwiki_global_vars[key] = users_value let g:vimwiki_global_vars[key] = users_value
" Remove users_value to prevent type mismatch (E706) errors in vim <7.4.1546
unlet users_value
else else
let g:vimwiki_global_vars[key] = global_settings[key].default let g:vimwiki_global_vars[key] = global_settings[key].default
endif endif

View File

@ -3313,6 +3313,7 @@ Contributors and their Github usernames in roughly chronological order:
- Patrik Willard (@padowi) - Patrik Willard (@padowi)
- Steve Dondley (@sdondley) - Steve Dondley (@sdondley)
- Alexander Gude (@agude) - Alexander Gude (@agude)
- Jonny Bylsma (@jbylsma)
============================================================================== ==============================================================================
@ -3331,6 +3332,7 @@ New:~
* PR #689: Allow |vimwiki-option-diary_rel_path| to be an empty string. * PR #689: Allow |vimwiki-option-diary_rel_path| to be an empty string.
* PR #683: Improve layout and format of key binding documentation in * PR #683: Improve layout and format of key binding documentation in
README and include note about key bindings that may not work. README and include note about key bindings that may not work.
* PR #681: Prevent sticky type checking errors for old vim versions.
* PR #675: Add option |vimwiki-option-name| to assign a per wiki name. * PR #675: Add option |vimwiki-option-name| to assign a per wiki name.
* PR #661: Add option |g:vimwiki_auto_header| to automatically generate * PR #661: Add option |g:vimwiki_auto_header| to automatically generate
a level 1 header for new wiki pages. a level 1 header for new wiki pages.