MCPcopy Index your code
hub / github.com/csev/py4e / markText

Function markText

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1632–1648  ·  view source on GitHub ↗
(from, to, className)

Source from the content-addressed store, hash-verified

1630 };
1631
1632 function markText(from, to, className) {
1633 from = clipPos(from); to = clipPos(to);
1634 var tm = new TextMarker();
1635 if (!posLess(from, to)) return tm;
1636 function add(line, from, to, className) {
1637 getLine(line).addMark(new MarkedText(from, to, className, tm));
1638 }
1639 if (from.line == to.line) add(from.line, from.ch, to.ch, className);
1640 else {
1641 add(from.line, from.ch, null, className);
1642 for (var i = from.line + 1, e = to.line; i < e; ++i)
1643 add(i, null, null, className);
1644 add(to.line, null, to.ch, className);
1645 }
1646 changes.push({from: from.line, to: to.line + 1});
1647 return tm;
1648 }
1649
1650 function setBookmark(pos) {
1651 pos = clipPos(pos);

Callers 1

matchBracketsFunction · 0.70

Calls 3

clipPosFunction · 0.70
posLessFunction · 0.70
addFunction · 0.70

Tested by

no test coverage detected