E53E Prevent sticky type checking (E706) errors with older Vims by jbylsma · Pull Request #681 · vimwiki/vimwiki · GitHub
[go: up one dir, main page]

Skip to content

Conversation

jbylsma
Copy link
Contributor
@jbylsma jbylsma commented Apr 23, 2019

I work on various servers that have an older copy of Vim installed. I noticed I was getting the following error during Vim startup:

Error detected while processing function vimwiki#vars#init..<SNR>51_populate_global_variables..<SNR>51_read_global_settings_from_user:
line   59:
E706: Variable type mismatch for: users_value
line   61:
E715: Dictionary required
Vimwiki Error: The provided value ''list'' of the option 'g:vimwiki_diary_months' is invalid. See ':h g:vimwiki_diary_months'.
line   70:
E706: Variable type mismatch for: users_value
line   71:
E715: Dictionary required
E714: List required
Press ENTER or type command to continue

The error was caused by setting let g:vimwiki_folding='list' in my configuration. 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. Simply unsetting the variable at the end of each loop seemed to fix the problem.

The vim error was removed in v7.4.1546 as part of vim/vim@f6f32c3.

@ranebrown
Copy link
Contributor
ranebrown commented Apr 25, 2019

@jbylsma Can you add a comment in the code explaining why the unlet is necessary so people know not to remove it down the road? Please include the Vim patch number in the comment.

@jbylsma
Copy link
Contributor Author
jbylsma commented Apr 26, 2019

Branch updated with explanation.

@ranebrown
Copy link
Contributor

Looks good. Resolve the conflicts with the latest dev branch and I'll get this merged.

jbylsma added 4 commits April 26, 2019 11:27
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
vim/vim@f6f32c3.
@jbylsma
Copy link
Contributor Author
jbylsma commented Apr 26, 2019

I had to fix the author email in the commits, so I rebased against the latest vimwiki/dev. I did put this PR sequentially in the changelog.

Thanks!

@ranebrown ranebrown merged commit e84dcbf into vimwiki:dev Apr 26, 2019
@jbylsma jbylsma deleted the prevent_e706_sticky_type_checking_error branch April 26, 2019 18:05
@ranebrown ranebrown mentioned this pull request Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0