atombender / sublime_text_alternative_autocompletion

Adds TextMate-like autocompletion to Sublime Text 2 and 3.
MIT License
147 stars 23 forks source link

Keybinding example breaks some default functionality #7

Closed Grepsy closed 11 years ago

Grepsy commented 12 years ago

The sample keybinding disables backing out of a snippet using escape and closing a panel(for example find), I've fixed this by adding some (more) exceptions to the context, might give a better experience. Thanks for the plugin, love it!

    // Alternative auto-complete
    { "keys": ["escape"], "command": "alternative_autocomplete", "context":
      [
        { "key": "num_selections", "operator": "equal", "operand": 1 },
        { "key": "overlay_visible", "operator": "equal", "operand": false },
        { "key": "panel_visible", "operator": "equal", "operand": false },
        { "key": "has_prev_field", "operator": "equal", "operand": false },
        { "key": "has_next_field", "operator": "equal", "operand": false }
      ]
    },
    { "keys": ["shift+escape"], "command": "alternative_autocomplete", "args": {"cycle": "previous"}, "context":
      [
        { "key": "num_selections", "operator": "equal", "operand": 1 },
        { "key": "overlay_visible", "operator": "equal", "operand": false },
        { "key": "panel_visible", "operator": "equal", "operand": false },
        { "key": "has_prev_field", "operator": "equal", "operand": false },
        { "key": "has_next_field", "operator": "equal", "operand": false }
      ]
    }
MarioRicalde commented 12 years ago

Please, merge this already. It works and it's something that should be in the repository by default. If you don't intend to implement it, please tell us so we can make a fork and maintain the package there.

MarioRicalde commented 12 years ago

Also add:

    { "key": "auto_complete_visible", "operator": "equal", "operand": false },

to prevent a bug with the new auocomplete popup

atombender commented 11 years ago

Sorry about the day. Was not paying attention. Fixed now.