mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
menu: support :emenu invoked by cmenu map.
This commit is contained in:
parent
f454e4bb11
commit
2788f7fcc8
@ -1262,6 +1262,9 @@ void ex_emenu(exarg_T *eap)
|
||||
if (((State & INSERT) || restart_edit) && !current_SID) {
|
||||
mode = (char_u *)"Insert";
|
||||
idx = MENU_INDEX_INSERT;
|
||||
} else if (State & CMDLINE) {
|
||||
mode = (char_u *)"Command";
|
||||
idx = MENU_INDEX_CMDLINE;
|
||||
} else if (get_real_state() & VISUAL) {
|
||||
/* Detect real visual mode -- if we are really in visual mode we
|
||||
* don't need to do any guesswork to figure out what the selection
|
||||
|
@ -1,4 +1,5 @@
|
||||
local helpers = require('test.functional.helpers')
|
||||
local Screen = require('test.functional.ui.screen').new(40,4)
|
||||
local clear, execute, nvim = helpers.clear, helpers.execute, helpers.nvim
|
||||
local expect = helpers.expect
|
||||
local feed = helpers.feed
|
||||
@ -36,3 +37,25 @@ describe(':emenu', function()
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
describe('emenu Edit.Paste while in commandline', function()
|
||||
before_each(function()
|
||||
clear()
|
||||
screen = Screen.new(40, 4)
|
||||
screen:attach()
|
||||
end)
|
||||
|
||||
it('ok', function()
|
||||
nvim('command', 'runtime menu.vim')
|
||||
feed('ithis is a sentence<esc>^"+yiwo<esc>')
|
||||
nvim('command', 'emenu Edit.Paste')
|
||||
feed(':')
|
||||
nvim('command', 'emenu Edit.Paste')
|
||||
screen:expect([[
|
||||
this is a sentence |
|
||||
this |
|
||||
~ |
|
||||
:this^ |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user