Sublime Forum

Completions not working after Tab binding set up

#1

I recently installed Emmet and added the following to my Default.sublime-keymap - User to get an html tag autocomplete when pressing tab key. Example: typing div then press tab and get <div></div>:

  {
    "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context": [
        {
            "operand": "source.js",
            "operator": "equal",
            "match_all": true,
            "key": "selector"
        },
        {
            "key": "selection_empty",
            "operator": "equal",
            "operand": true,
            "match_all": true
        }
    ]
  },
  { "keys": ["tab"], "command": "next_field", "context":
    [
        { "key": "has_next_field", "operator": "equal", "operand": true }
    ]
  }
]

But now, every time I have a completion suggested in the popup menu, if I try to select it by pressing the Enter key or the Tab key, then an html tag with whatever I had typed so far shows up. Example: if I am typing React and the popup menu shows up ReactDOM, if I highlight it and then press enter key or tab key I would get <React></React>

0 Likes

#2

The auto_complete_visible should do the trick.

  {
    "keys": ["tab"], "command": "expand_abbreviation_by_tab", "context": [
        { "key": "selector", "operand": "source.js"  },
        { "key": "selection_empty" },
        { "key": "auto_complete_visible", "operand": false },
    ]
  },	
1 Like

#3

Thanks! This worked like a charm!!

0 Likes