From e84dcbfa2574bdce92cb6070929db36326882a69 Mon Sep 17 00:00:00 2001 From: Jonny Bylsma Date: Fri, 26 Apr 2019 13:06:09 -0400 Subject: [PATCH] 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 https://github.com/vim/vim/commit/f6f32c38bf3319144a84a01a154c8c91939e7acf. --- autoload/vimwiki/vars.vim | 2 ++ doc/vimwiki.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim index f3c4f05..5e0aaed 100644 --- a/autoload/vimwiki/vars.vim +++ b/autoload/vimwiki/vars.vim @@ -203,6 +203,8 @@ function! s:read_global_settings_from_user() call s:check_users_value(key, users_value, value_infos, 1) 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 let g:vimwiki_global_vars[key] = global_settings[key].default endif diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 4bc2c3f..8e6d359 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -3313,6 +3313,7 @@ Contributors and their Github usernames in roughly chronological order: - Patrik Willard (@padowi) - Steve Dondley (@sdondley) - 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 #683: Improve layout and format of key binding documentation in 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 #661: Add option |g:vimwiki_auto_header| to automatically generate a level 1 header for new wiki pages.