Sublime Forum

What is going on here? Tab key duplicates the 2nd line on to the first line

#1

I have the below two lines in Sublime 3. With cursor at the end of the 1st line, press the Tab key. It copies the 2nd line on top of it. I used “tab_completion”: false to turn it off, but I wish this was the default. Scary when you are coding or data typing.

B
BADDDDDX

or

CAD
CADDDDDY
0 Likes

#2

I’ve also never liked the default keybinding of Tab to execute the insert_best_completion command, and wish there was a separate setting to disable it, so that it only commits completions that are shown.

0 Likes

Tabbing to indent inserts text instead
#3

I just added this to my user keybindings to fix the bug whereby pressing Tab at the start of a line that contains text (i.e. caret is after any whitespace, and immediately before text), inserts the best completion instead of indents the line:

{ "keys": ["tab"], "command": "indent",
    "context":
    [
        { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "following_text", "operator": "not_regex_match", "operand": "^$", "match_all": true },
    ]
},
{ "keys": ["tab"], "command": "insert", "args": { "characters": "\t" },
    "context":
    [
        { "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*$", "match_all": true },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true },
    ]
},
0 Likes

[BUG] Indent a line starting with a **-** in a text file and **-1** or **-1908** appear!