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

Function prepareMeasureForLine

GUI/codemirror/lib/codemirror.js:1534–1550  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

1532 // measurements in a row, can thus ensure that the set-up work is
1533 // only done once.
1534 function prepareMeasureForLine(cm, line) {
1535 var lineN = lineNo(line);
1536 var view = findViewForLine(cm, lineN);
1537 if (view && !view.text)
1538 view = null;
1539 else if (view && view.changes)
1540 updateLineForChanges(cm, view, lineN, getDimensions(cm));
1541 if (!view)
1542 view = updateExternalMeasurement(cm, line);
1543
1544 var info = mapFromLineView(view, line, lineN);
1545 return {
1546 line: line, view: view, rect: null,
1547 map: info.map, cache: info.cache, before: info.before,
1548 hasHeights: false
1549 };
1550 }
1551
1552 // Given a prepared measurement object, measures the position of an
1553 // actual character (or fetches it from the cache).

Callers 3

measureCharFunction · 0.85
cursorCoordsFunction · 0.85
coordsCharInnerFunction · 0.85

Calls 6

lineNoFunction · 0.85
findViewForLineFunction · 0.85
updateLineForChangesFunction · 0.85
getDimensionsFunction · 0.85
mapFromLineViewFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…