Skip to content

Some mappings with punctuation fail on newer Vim/Neovim versions #38

@suy

Description

@suy

I think the issue is not just in Neovim, but also on newer Vim versions (I get the same issue with Vim 8.2, though my config has too many Neovim stuff to be sure). My issue doesn't happen in general, but specifically with the maps that I'm defining, and I think it's because they have "special" characters. For example:

	call submode#enter_with('resize-window', 'n', '', '<C-W>+', '<C-W>+')

Then vim-submode wants to create a few <Plug> mappings with the parameters passed (on s:define_entering_mapping) by calling execute and passing a few string parameters.

The odd thing, is that only one execute fails. For example, this works:

  execute s:map_command(a:mode, 'r')
  \       s:map_options(s:filter_flags(a:options, 'bu'))
  \       (a:lhs)
  \       (s:named_key_before_entering_with(a:submode, a:lhs)
  \        . s:named_key_before_entering(a:submode)
  \        . s:named_key_enter(a:submode))

But this one doesn't (and if I comment it out, the rest of the mappings seem to be created without errors):

  execute s:map_command(a:mode, s:filter_flags(a:options, 'r'))
  \       s:map_options(s:filter_flags(a:options, 'besu'))
  \       s:named_key_before_entering_with(a:submode, a:lhs)
  \       a:rhs

I put some message printing, and it seems that the above line would be:

  execute 'nnoremap' '' '<Plug>(submode-before-entering:resize-window:with:<C-W>+)' '<C-W>+'

So if I edit the arguments slightly, I get it to not fail. I just don't really know what a proper solution is, but it seems it's a behavior change in newer versions, and converting to string the arguments of submode#enter_with doesn't work as is. Perhaps some escaping is necessary?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions