Skip to content

Commit

Permalink
Fix escaping in auto-pair bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed Aug 8, 2015
1 parent e753ef4 commit a517b90
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions Keymaps/Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -94,8 +94,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down Expand Up @@ -195,13 +195,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -271,8 +271,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down Expand Up @@ -372,13 +372,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -448,8 +448,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down Expand Up @@ -549,13 +549,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -625,8 +625,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down Expand Up @@ -726,13 +726,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -802,8 +802,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down Expand Up @@ -903,13 +903,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -979,8 +979,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down Expand Up @@ -1080,13 +1080,13 @@
{
"key": "following_text",
"operator": "regex_contains",
"operand": "^(?:$|\\s|\\)|]|\\}|\\*|_|`)",
"operand": "^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)",
"match_all": true
},
{
"key": "preceding_text",
"operator": "regex_contains",
"operand": "(?:^|\\s|\\(|[|]|\\*|_|`)$",
"operand": "(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$",
"match_all": true
},
{
Expand Down Expand Up @@ -1156,8 +1156,8 @@
],
"command": "move",
"args": {
"forward": true,
"by": "characters"
"by": "characters",
"forward": true
},
"context": [
{
Expand Down
4 changes: 2 additions & 2 deletions Keymaps/Default.sublime-keymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def paired_chars(left, right):
bind(left)
.to('insert_snippet', contents="%s$0%s" % (left, right))
.when('selection_empty').true()
.also('following_text').regex_contains('^(?:$|\\s|\\)|]|\\}|\\*|_|`)')
.also('preceding_text').regex_contains('(?:^|\\s|\\(|[|]|\\*|_|`)$')
.also('following_text').regex_contains('^(?:$|\\s|\\)|\\]|\\}|\\*|_|\\`)')
.also('preceding_text').regex_contains('(?:^|\\s|\\(|\\[|\\]|\\*|_|\\`)$')
.also('eol_selector').not_equal('string.quoted.single'),

# When you select some text and type the left char, then the selection
Expand Down

0 comments on commit a517b90

Please sign in to comment.