Home | History | Annotate | Download | only in cm

Lines Matching defs:Pos

5   var Pos = CodeMirror.Pos;
12 var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
13 var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
16 if (strict && forward != (pos == cur.ch)) return null;
17 var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1));
19 var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
22 var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
24 if (start != null) pos = start + d;
25 for (; pos != end; pos += d) {
26 var ch = line.text.charAt(pos);
27 if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) {
30 else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
31 else if (!stack.length) return {pos: pos, match: true};
36 if (i == cur.line) found = scan(line, i, pos);
40 return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos),
53 var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style});
54 var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style});
83 CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){
84 return findMatchingBracket(this, pos, strict);