Skip to content
Snippets Groups Projects
Commit dff59d6d authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[matchbrackets addon] Work around IE7 bug

Where it mysteriously makes the editor stop working (typed input no longer goes to
textarea) whenever highlighting fires.

Issue #1193
parent a45e876c
No related branches found
No related tags found
No related merge requests found
(function() {
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
(document.documentMode == null || document.documentMode < 8);
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
function findMatchingBracket(cm) {
var cur = cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
......@@ -38,6 +41,9 @@
{className: style});
var two = found.to && cm.markText(found.to, {line: found.to.line, ch: found.to.ch + 1},
{className: style});
// Kludge to work around the IE bug from issue #1193, where text
// input stops going to the textare whever this fires.
if (ie_lt8 && cm.state.focused) cm.display.input.focus();
var clear = function() {
cm.operation(function() { one.clear(); two && two.clear(); });
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment