(cm)
| 9170 | } |
| 9171 | |
| 9172 | function toEnclosingExpr(cm) { |
| 9173 | var pos = cm.getCursor(), line = pos.line, ch = pos.ch; |
| 9174 | var stack = []; |
| 9175 | while (line >= cm.firstLine()) { |
| 9176 | var text = cm.getLine(line); |
| 9177 | for (var i = ch == null ? text.length : ch; i > 0;) { |
| 9178 | var ch = text.charAt(--i); |
| 9179 | if (ch == ")") |
| 9180 | stack.push("("); |
| 9181 | else if (ch == "]") |
| 9182 | stack.push("["); |
| 9183 | else if (ch == "}") |
| 9184 | stack.push("{"); |
| 9185 | else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch)) |
| 9186 | return cm.extendSelection(Pos(line, i)); |
| 9187 | } |
| 9188 | --line; ch = null; |
| 9189 | } |
| 9190 | } |
| 9191 | |
| 9192 | function quit(cm) { |
| 9193 | cm.execCommand("clearSearch"); |
nothing calls this directly
no test coverage detected