We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 344c8d5 commit edd8e61Copy full SHA for edd8e61
addon/edit/closebrackets.js
@@ -116,7 +116,9 @@
116
if (opening && !range.empty()) {
117
curType = "surround";
118
} else if ((identical || !opening) && next == ch) {
119
- if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
+ if (identical && stringStartsAfter(cm, cur))
120
+ curType = "both";
121
+ else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
122
curType = "skipThree";
123
else
124
curType = "skip";
@@ -192,4 +194,9 @@
192
194
stream.start = stream.pos;
193
195
}
196
197
+
198
+ function stringStartsAfter(cm, pos) {
199
+ var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
200
+ return /\bstring/.test(token.type) && token.start == pos.ch
201
+ }
202
});
0 commit comments