MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / updateFatCursorMark

Function updateFatCursorMark

lib/web/CodeMirror/keymap/vim.js:294–313  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

292 }
293
294 function updateFatCursorMark(cm) {
295 if (!cm.state.fatCursorMarks) return;
296 clearFatCursorMark(cm);
297 var ranges = cm.listSelections(), result = []
298 for (var i = 0; i < ranges.length; i++) {
299 var range = ranges[i];
300 if (range.empty()) {
301 var lineLength = cm.getLine(range.anchor.line).length;
302 if (range.anchor.ch < lineLength) {
303 result.push(cm.markText(range.anchor, Pos(range.anchor.line, range.anchor.ch + 1),
304 {className: "cm-fat-cursor-mark"}));
305 } else {
306 result.push(cm.markText(Pos(range.anchor.line, lineLength - 1),
307 Pos(range.anchor.line, lineLength),
308 {className: "cm-fat-cursor-mark"}));
309 }
310 }
311 }
312 cm.state.fatCursorMarks = result;
313 }
314
315 function clearFatCursorMark(cm) {
316 var marks = cm.state.fatCursorMarks;

Callers 1

enableFatCursorMarkFunction · 0.85

Calls 5

clearFatCursorMarkFunction · 0.85
emptyMethod · 0.80
getLineMethod · 0.65
PosFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected