MCPcopy Create free account
hub / github.com/sql-js/sql.js / drawSelectionCursor

Function drawSelectionCursor

GUI/codemirror/lib/codemirror.js:1271–1287  ·  view source on GitHub ↗
(cm, range, output)

Source from the content-addressed store, hash-verified

1269
1270 // Draws a cursor for the given range
1271 function drawSelectionCursor(cm, range, output) {
1272 var pos = cursorCoords(cm, range.head, "div");
1273
1274 var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
1275 cursor.style.left = pos.left + "px";
1276 cursor.style.top = pos.top + "px";
1277 cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
1278
1279 if (pos.other) {
1280 // Secondary cursor, shown when on a 'jump' in bi-directional text
1281 var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
1282 otherCursor.style.display = "";
1283 otherCursor.style.left = pos.other.left + "px";
1284 otherCursor.style.top = pos.other.top + "px";
1285 otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
1286 }
1287 }
1288
1289 // Draws the given range as a highlighted selection
1290 function drawSelectionRange(cm, range, output) {

Callers 1

updateSelectionFunction · 0.85

Calls 2

cursorCoordsFunction · 0.85
eltFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…