Skip to content

:emenu behaves differently when called from a user command defined in a script #12135

@zeertzjq

Description

@zeertzjq

Steps to reproduce

  1. Run vim --clean
  2. Source the following file:
let g:log = []
nnoremenu Foo.Bar <Cmd>let g:log += ['n']<CR>
inoremenu Foo.Bar <Cmd>let g:log += ['i']<CR>
command -nargs=* Emenu emenu <args>
call feedkeys("i\<C-O>:emenu Foo.Bar\<CR>\<C-O>:Emenu Foo.Bar\<CR>\<Esc>", 't')
  1. Running :echo g:log print ['i', 'n']

Expected behaviour

I guess ['i', 'i'] may be the expected behavior, but maybe the current behavior isn't worth changing?

Version of Vim

9.0.1337

Environment

Operating system: Arch Linux
Terminal: kitty
Value of $TERM: xterm-kitty
Shell: fish

Logs and stack traces

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions