JuliaEditorSupport / julia-vim

Vim support for Julia.
http://julialang.org/
Other
752 stars 94 forks source link

handle edge case in L2U_SetFallbackMapping in which rhs key is missing #302

Closed ExpandingMan closed 2 years ago

ExpandingMan commented 2 years ago

I think this fixes #301 in which a key mapping dictionary in the function L2U_SetFallbackMapping is missing the expected key "rhs". This dictionary is evidently the result of a call to the built-in function maparg which is supposed to return a dictionary with a set of keys including "rhs". It might be that recent versions of neovim are breaking this by failing to guarantee that all keys are present, who knows.

I'm less than 100% confident this fixes the error I was seeing (I was never able to come up with an MWE) but so far so good. If I see the error again after this change I will of course update this thread.

danielwe commented 2 years ago

+1 for merging this

carlobaldassi commented 2 years ago

Thanks! And sorry for the long wait. Indeed, re-reading the documentation carefully, it seems that the rhs may be missing in a mapping. I think this does not restore the empty mapping when the plugin unloads, but I'm not sure that's a problem...