{"action":"created","issue":{"url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/963","repository_url":"https://api.github.com/repos/SublimeText/LaTeXTools","labels_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/963/labels{/name}","comments_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/963/comments","events_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/963/events","html_url":"https://github.com/SublimeText/LaTeXTools/issues/963","id":191877905,"number":963,"title":"Auto-pair escaped curly braces","user":{"login":"FichteFoll","id":931051,"avatar_url":"https://avatars.githubusercontent.com/u/931051?v=3","gravatar_id":"","url":"https://api.github.com/users/FichteFoll","html_url":"https://github.com/FichteFoll","followers_url":"https://api.github.com/users/FichteFoll/followers","following_url":"https://api.github.com/users/FichteFoll/following{/other_user}","gists_url":"https://api.github.com/users/FichteFoll/gists{/gist_id}","starred_url":"https://api.github.com/users/FichteFoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FichteFoll/subscriptions","organizations_url":"https://api.github.com/users/FichteFoll/orgs","repos_url":"https://api.github.com/users/FichteFoll/repos","events_url":"https://api.github.com/users/FichteFoll/events{/privacy}","received_events_url":"https://api.github.com/users/FichteFoll/received_events","type":"User","site_admin":false},"labels":[{"id":324741183,"url":"https://api.github.com/repos/SublimeText/LaTeXTools/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-27T18:57:41Z","updated_at":"2016-12-06T13:40:45Z","closed_at":null,"body":"Here is what I added to my key bindings just now:\r\n\r\n```js\r\n[\r\n  // Auto-pair escaped curly brackets in tex\r\n  { \"keys\": [\"{\"], \"command\": \"insert_snippet\", \"args\": {\"contents\": \"{$0\\\\\\\\}\"}, \"context\":\r\n    [\r\n      { \"key\": \"setting.auto_match_enabled\", \"operator\": \"equal\", \"operand\": true },\r\n      { \"key\": \"selection_empty\", \"operator\": \"equal\", \"operand\": true, \"match_all\": true },\r\n      { \"key\": \"preceding_text\", \"operator\": \"regex_contains\", \"operand\": \"\\\\\\\\$\", \"match_all\": true },\r\n      { \"key\": \"following_text\", \"operator\": \"regex_contains\", \"operand\": \"^(\\\\s|\\\\)|]|\\\\}|\\\\\\\\|$)\", \"match_all\": true },\r\n      { \"key\": \"selector\", \"operand\": \"text.tex\", \"match_all\": true }\r\n    ]\r\n  },\r\n  { \"keys\": [\"backspace\"], \"command\": \"run_macro_file\", \"args\": {\"file\": \"res://Packages/User/Delete Left Right Twice.sublime-macro\"}, \"context\":\r\n    [\r\n      { \"key\": \"setting.auto_match_enabled\", \"operator\": \"equal\", \"operand\": true },\r\n      { \"key\": \"selection_empty\", \"operator\": \"equal\", \"operand\": true, \"match_all\": true },\r\n      { \"key\": \"preceding_text\", \"operator\": \"regex_contains\", \"operand\": \"\\\\\\\\\\\\{$\", \"match_all\": true },\r\n      { \"key\": \"following_text\", \"operator\": \"regex_contains\", \"operand\": \"^\\\\\\\\\\\\}\", \"match_all\": true },\r\n      { \"key\": \"selector\", \"operand\": \"text.tex\", \"match_all\": true }\r\n    ]\r\n  }\r\n]\r\n```\r\n\r\nI believe this would be a good addition to LaTeXTools.\r\nNote that I didn't add a binding to skip over the closing brace because ... I don't think there is a good user pattern for it.\r\nAlso note that the incredibly complicated macro file needs to be provided by LaTeXTools as well:\r\n\r\n```json\r\n[\r\n    {\"command\": \"left_delete\" },\r\n    {\"command\": \"right_delete\" },\r\n    {\"command\": \"left_delete\" },\r\n    {\"command\": \"right_delete\" }\r\n]\r\n```"},"comment":{"url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/comments/265151835","html_url":"https://github.com/SublimeText/LaTeXTools/issues/963#issuecomment-265151835","issue_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/963","id":265151835,"user":{"login":"FichteFoll","id":931051,"avatar_url":"https://avatars.githubusercontent.com/u/931051?v=3","gravatar_id":"","url":"https://api.github.com/users/FichteFoll","html_url":"https://github.com/FichteFoll","followers_url":"https://api.github.com/users/FichteFoll/followers","following_url":"https://api.github.com/users/FichteFoll/following{/other_user}","gists_url":"https://api.github.com/users/FichteFoll/gists{/gist_id}","starred_url":"https://api.github.com/users/FichteFoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FichteFoll/subscriptions","organizations_url":"https://api.github.com/users/FichteFoll/orgs","repos_url":"https://api.github.com/users/FichteFoll/repos","events_url":"https://api.github.com/users/FichteFoll/events{/privacy}","received_events_url":"https://api.github.com/users/FichteFoll/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T13:40:45Z","updated_at":"2016-12-06T13:40:45Z","body":"@randy3k, that would work too. Actually, since `sublime_plugin.py` scans all attributes of the module, you wouldn't even need to subclass and `from RSteinCompletionSystem.commands import NavigateCommand` would already be enough to make ST pick up the `navigate` command."}}
{"actor":{"display_login":"FichteFoll"}}