{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/3386","labels_url":"https://api.github.com/repos/neovim/neovim/issues/3386/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/3386/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/3386/events","html_url":"https://github.com/neovim/neovim/issues/3386","id":108244551,"number":3386,"title":":emenu not executing command mode commands","user":{"login":"bambu","id":564972,"avatar_url":"https://avatars.githubusercontent.com/u/564972?v=3","gravatar_id":"","url":"https://api.github.com/users/bambu","html_url":"https://github.com/bambu","followers_url":"https://api.github.com/users/bambu/followers","following_url":"https://api.github.com/users/bambu/following{/other_user}","gists_url":"https://api.github.com/users/bambu/gists{/gist_id}","starred_url":"https://api.github.com/users/bambu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bambu/subscriptions","organizations_url":"https://api.github.com/users/bambu/orgs","repos_url":"https://api.github.com/users/bambu/repos","events_url":"https://api.github.com/users/bambu/events{/privacy}","received_events_url":"https://api.github.com/users/bambu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neovim/neovim/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/neovim/neovim/labels/clipboard","name":"clipboard","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/neovim/neovim/milestones/10","html_url":"https://github.com/neovim/neovim/milestones/0.2","labels_url":"https://api.github.com/repos/neovim/neovim/milestones/10/labels","id":1183808,"number":10,"title":"0.2","description":"beta release, codename: \"keanu\"","creator":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"open_issues":85,"closed_issues":13,"state":"open","created_at":"2015-06-27T19:05:24Z","updated_at":"2015-09-25T05:59:02Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-09-25T01:19:50Z","updated_at":"2015-09-26T00:06:30Z","closed_at":null,"body":"I am sending the command  `emenu Edit.Paste` while in command mode and instead of getting the text that is in the clipboard as is done  when pasting in both normal and insert mode, it just pastes `\"+gP^`.  Am I supposed to be doing anything different to get the command mode menu to work?\r\n\r\nDoing `:amenu Edit.Paste` shows that it should do ` <C-R>+`\r\n```vim\r\n360 &Paste^I\"+gP\r\n    n*   \"+gP\r\n    v&   \"-c<Esc>:call paste#Paste()<CR>\r\n    s&   \"-c<Esc>:call paste#Paste()<CR>\r\n    i&   x<BS><Esc>:call paste#Paste()<CR>gi\r\n    c*   <C-R>+\r\n````\r\nHowever, doing `:menu Edit.Paste` does not show the `<C-R>+`:\r\n````vim\r\n360 &Paste^I\"+gP\r\n    n*   \"+gP\r\n    v&   \"-c<Esc>:call paste#Paste()<CR>\r\n    s&   \"-c<Esc>:call paste#Paste()<CR>\r\n```\r\n\r\nHere's a test that replicates the issue. It should work being inserted into the `input_spec.lua`. The test loads menu.vim, inserts some text and copies the first word, pastes it to make sure that paste works, goes into command mode and tries to paste again. \r\n\r\n```lua\r\ndescribe('Paste in commandline', function()\r\n    it('ok', function()\r\n        local screen = require('test.functional.ui.screen').new()\r\n        screen:attach()\r\n        nvim('command', 'runtime menu.vim')\r\n        feed('ithis is a sentence<esc>^\"+yiwo<esc>')\r\n        nvim('command', 'emenu Edit.Paste')\r\n        feed(':')\r\n        nvim('command', 'emenu Edit.Paste')\r\n        screen:snapshot_util({}, true)\r\n        screen:expect([[\r\n          this is a sentence                                   |\r\n          this                                                 |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          ~                                                    |\r\n          :this^                                                |\r\n        ]])\r\n    end)\r\nend)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/143380308","html_url":"https://github.com/neovim/neovim/issues/3386#issuecomment-143380308","issue_url":"https://api.github.com/repos/neovim/neovim/issues/3386","id":143380308,"user":{"login":"bambu","id":564972,"avatar_url":"https://avatars.githubusercontent.com/u/564972?v=3","gravatar_id":"","url":"https://api.github.com/users/bambu","html_url":"https://github.com/bambu","followers_url":"https://api.github.com/users/bambu/followers","following_url":"https://api.github.com/users/bambu/following{/other_user}","gists_url":"https://api.github.com/users/bambu/gists{/gist_id}","starred_url":"https://api.github.com/users/bambu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bambu/subscriptions","organizations_url":"https://api.github.com/users/bambu/orgs","repos_url":"https://api.github.com/users/bambu/repos","events_url":"https://api.github.com/users/bambu/events{/privacy}","received_events_url":"https://api.github.com/users/bambu/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T00:06:30Z","updated_at":"2015-09-26T00:06:30Z","body":"Nevermind. I was dumb. I put the wrong idx type. Changing it to `MENU_INDEX_CMDLINE` fixes the problem and allows pasting to work. :-) \r\n\r\n```c\r\nelse if((State & CMDLINE)) {\r\n      mode = (char_u *)\"Command\";\r\n      idx = MENU_INDEX_CMDLINE;\r\n  }\r\n```"}}