ChainOfCommand
ChainOfCommand copied to clipboard
hide_auto_complete prevents moving cursor down
I was trying to prevent the arrow keys from being used to navigate the auto-completion menu. When I press the down arrow it should close the auto-complete menu and move down a line. The problem is that using the 'hide_auto_complete' command prevents subsequent commands from moving the cursor down by a line.
Intuitively I think this should work. It doesn't for me currently
{ "keys": ["down"], "command": "chain",
"args": {
"commands": [
// hides the auto-complete popup
[ "hide_auto_complete" ],
// moves the cursor down
[ "move", { "by": "lines", "forward": true } ]
]
},
"context": [{ "key": "auto_complete_visible" }]
},
However the following does work
{ "keys": ["down"], "command": "chain",
"args": {
"commands": [
// make the auto-complete menu hide by moving the cursor a character forward
[ "move", { "by": "characters", "forward": true } ],
// undo the cursor move used to hide the auto-complete window
[ "move", { "by": "characters", "forward": false } ],
// moves the cursor down
[ "move", { "by": "lines", "forward": true } ]
]
},
"context": [{ "key": "auto_complete_visible" }]
},