Sublime a ce comportement qui est vraiment ennuyeux parfois lorsque vous devez taper des constructions avec beaucoup de crochets. Lorsque vous tapez (
, il ajoute ()
et place le curseur au milieu, tout va bien, si vous tapez cependant )
, il va avaler silencieusement le crochet de fermeture.
C'est vraiment ennuyeux lors de la saisie de longues regex car les crochets sont rapidement déséquilibrés et cela me rend fou. Donc, vous vous retrouvez avec des constructions comme (([a-z])
.
La question est donc - y a-t-il un moyen de désactiver cela ? Si je tape un crochet fermant, je veux qu'il reste là, ne pas être avalé.
J'ai vérifié à travers les configurations de Sublime, j'ai googlé, mais personne ne semble se soucier de ce comportement. Est-ce que je m'en sers mal ?
Mise à jour
Vous voudrez peut-être consulter le raccourci Sublime: Jump out of matching brackets également.
Version complète qui vous permet de taper avec ()
mais ne va pas avaler le symbole de fermeture si vous avez saisi un texte :
{ "keys": [\""], "command": "insert", "args": {"characters": "\""}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[^\"]$", "match_all": true }
]
},
{ "keys": [")"], "command": "insert", "args": {"characters": ")"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[^(]$", "match_all": true }
]
},
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true }
]
},
{ "keys": ["'"], "command": "insert", "args": {"characters": "'"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "'$", "match_all": true }
]
},
{ "keys": ["]"],"command": "insert", "args": {"characters": "]"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "[$", "match_all": true }
]
},
{ "keys": ["}"], "command": "insert", "args": {"characters": "}"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }
]
}