Skip to content

vim-repeat mappings (., u, etc) emits CmdlineLeave event which disrupts im-select.nvim #104

Description

@kkew3

Hi, thanks for this great plugin.

I'm using keaising/im-select.nvim to change input methods (IM) (e.g. between English and Chinese). I find that CmdlineLeave must be removed from set_default_events (see example from https://github.com/keaising/im-select.nvim#2-install-and-setup-this-plugin) for vim-repeat's . and u to not unexpectedly reset the IM. This is because

nnoremap <silent> <Plug>(RepeatDot) :<C-U>if !repeat#run(v:count)<Bar>echoerr repeat#errmsg()<Bar>endif<CR>
nmap <silent><expr><script> <Plug>(RepeatUndo) repeat#wrap('u',v:count)
nmap <silent><expr><script> <Plug>(RepeatUndoLine) repeat#wrap('U',v:count)
nmap <silent><expr><script> <Plug>(RepeatRedo) repeat#wrap("\022",v:count)

uses :<C-u>...<CR> which enters cmdline then leaves, emitting an unwanted CmdlineLeave event.

FYI in Nov 2020, Vim-8.2.1978 introduced <Cmd> mapping. If the above pattern is replaced with <Cmd>...<CR>, then the issue will be resolved. I'm willing to submit a pull request for it.

For more context, see:

Thank you so much!

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