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

Function selectWordAt

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1501–1507  ·  view source on GitHub ↗
(pos)

Source from the content-addressed store, hash-verified

1499 }
1500
1501 function selectWordAt(pos) {
1502 var line = getLine(pos.line).text;
1503 var start = pos.ch, end = pos.ch;
1504 while (start > 0 && isWordChar(line.charAt(start - 1))) --start;
1505 while (end < line.length && isWordChar(line.charAt(end))) ++end;
1506 setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end});
1507 }
1508 function selectLine(line) {
1509 setSelectionUser({line: line, ch: 0}, clipPos({line: line + 1, ch: 0}));
1510 }

Callers 2

onMouseDownFunction · 0.85
onDoubleClickFunction · 0.85

Calls 3

setSelectionUserFunction · 0.85
getLineFunction · 0.70
isWordCharFunction · 0.70

Tested by

no test coverage detected