MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / updateSelectionCursor

Function updateSelectionCursor

static/js/codemirror/codemirror.js:747–760  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

745
746 // No selection, plain cursor
747 function updateSelectionCursor(cm) {
748 var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div");
749 display.cursor.style.left = pos.left + "px";
750 display.cursor.style.top = pos.top + "px";
751 display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
752 display.cursor.style.display = "";
753
754 if (pos.other) {
755 display.otherCursor.style.display = "";
756 display.otherCursor.style.left = pos.other.left + "px";
757 display.otherCursor.style.top = pos.other.top + "px";
758 display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
759 } else { display.otherCursor.style.display = "none"; }
760 }
761
762 // Highlight selection
763 function updateSelectionRange(cm) {

Callers 1

updateSelectionFunction · 0.85

Calls 1

cursorCoordsFunction · 0.85

Tested by

no test coverage detected