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

Function doSelect

tools/pythonauto/static/codemirror/codemirror.js:1801–1820  ·  view source on GitHub ↗
(cur)

Source from the content-addressed store, hash-verified

1799 var startstart = sel.from, startend = sel.to, lastPos = start;
1800
1801 function doSelect(cur) {
1802 if (posEq(lastPos, cur)) return;
1803 lastPos = cur;
1804
1805 if (type == "single") {
1806 extendSelection(cm.doc, clipPos(doc, start), cur);
1807 return;
1808 }
1809
1810 startstart = clipPos(doc, startstart);
1811 startend = clipPos(doc, startend);
1812 if (type == "double") {
1813 var word = findWordAt(getLine(doc, cur.line).text, cur);
1814 if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend);
1815 else extendSelection(cm.doc, startstart, word.to);
1816 } else if (type == "triple") {
1817 if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0)));
1818 else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0)));
1819 }
1820 }
1821
1822 var editorSize = getRect(display.wrapper);
1823 // Used to ensure timeout re-tries don't fire when another extend

Callers 1

extendFunction · 0.85

Calls 7

PosFunction · 0.85
posEqFunction · 0.70
extendSelectionFunction · 0.70
clipPosFunction · 0.70
findWordAtFunction · 0.70
getLineFunction · 0.70
posLessFunction · 0.70

Tested by

no test coverage detected