jisaacks / ChainOfCommand

Sublime text plugin to run a chain of commands
67 stars 4 forks source link

hide_auto_complete prevents moving cursor down #8

Open eightys3v3n opened 7 years ago

eightys3v3n commented 7 years ago

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" }]
},