MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / wordAt

Function wordAt

static/plugins/codemirror/keymap/sublime.js:127–132  ·  view source on GitHub ↗
(cm, pos)

Source from the content-addressed store, hash-verified

125 cmds.insertLineBefore = function(cm) { return insertLine(cm, true); };
126
127 function wordAt(cm, pos) {
128 var start = pos.ch, end = start, line = cm.getLine(pos.line);
129 while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;
130 while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;
131 return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};
132 }
133
134 cmds.selectNextOccurrence = function(cm) {
135 var from = cm.getCursor("from"), to = cm.getCursor("to");

Callers 3

sublime.jsFile · 0.85
modifyWordOrSelectionFunction · 0.85
getTargetFunction · 0.85

Calls 1

PosFunction · 0.85

Tested by

no test coverage detected