Open haferburg opened 5 years ago
Ugly workaround using AutoHotkey:
#IfWinActive ahk_exe sublime_text.exe
^+v::
Send ^+v
Send {Down}
Send {Down}
return
#IfWinActive
I wonder about this. The paste_from_history
command uses the View.show_popup_menu
API to open a popup menu that the user can select from. This is just a custom context menu and adheres to various UI standards. E.g. when hovering over items and then leaving the menu, no item is selected.
However, when this is opened as a direct cause of a key press (i.e. through a key binding), I believe it makes sense to pre-select an item. The auto-complete panel works the same.
@FichteFoll Unfortunately you can't interact with the popup menu programmatically. There's the chain of command plugin, but I don't think you can use it to send the down
key to the menu.
Problem description
When I use
paste_from_history
, no item is selected. If I simply pressReturn
, nothing happens. In order to select the first item, I would need pressdown
. To select the second item, pressdown
twice, etc. I don't know if this is OS specific.Preferred solution
I find that Visual Assist found a nice solution.
ctrl+v
is paste, and pastes the last item from the copy history.ctrl+shift+v
followed byreturn
pastes the second last item from the copy history. This enables a nice workflow for two items: Copy two items a and b withctrl+c
, thenctrl+shift+v
followed byreturn
twice in a row to paste a followed by b.Another nice feature is that you can select items by hotkey from the
ctrl+shift+v
popup. I believe the first 9 items use numbers 1-9, the next items use letters a-z. These hotkeys are displayed next to the items.It would be nice if the
view.show_popup_menu
API would allow hotkeys and item pre-selection. There is aflags
parameter, but it's unused.Alternatives
Select the first or second item. Anything is better than nothing.
Additional Information (optional)
Windows 7 x64, ST3 build 3184.