MCPcopy
hub / github.com/witheve/Eve / drawSelectionCursor

Function drawSelectionCursor

src/codemirror.js:2330–2346  ·  view source on GitHub ↗
(cm, head, output)

Source from the content-addressed store, hash-verified

2328
2329 // Draws a cursor for the given range
2330 function drawSelectionCursor(cm, head, output) {
2331 var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine);
2332
2333 var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
2334 cursor.style.left = pos.left + "px";
2335 cursor.style.top = pos.top + "px";
2336 cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
2337
2338 if (pos.other) {
2339 // Secondary cursor, shown when on a 'jump' in bi-directional text
2340 var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
2341 otherCursor.style.display = "";
2342 otherCursor.style.left = pos.other.left + "px";
2343 otherCursor.style.top = pos.other.top + "px";
2344 otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
2345 }
2346 }
2347
2348 // Draws the given range as a highlighted selection
2349 function drawSelectionRange(cm, range, output) {

Callers 2

prepareSelectionFunction · 0.85
onDragOverFunction · 0.85

Calls 2

cursorCoordsFunction · 0.85
eltFunction · 0.85

Tested by

no test coverage detected