MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / prepareMeasureForLine

Function prepareMeasureForLine

static/plugins/codemirror/codemirror.js:2397–2415  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

2395 // measurements in a row, can thus ensure that the set-up work is
2396 // only done once.
2397 function prepareMeasureForLine(cm, line) {
2398 var lineN = lineNo(line);
2399 var view = findViewForLine(cm, lineN);
2400 if (view && !view.text) {
2401 view = null;
2402 } else if (view && view.changes) {
2403 updateLineForChanges(cm, view, lineN, getDimensions(cm));
2404 cm.curOp.forceUpdate = true;
2405 }
2406 if (!view)
2407 { view = updateExternalMeasurement(cm, line); }
2408
2409 var info = mapFromLineView(view, line, lineN);
2410 return {
2411 line: line, view: view, rect: null,
2412 map: info.map, cache: info.cache, before: info.before,
2413 hasHeights: false
2414 }
2415 }
2416
2417 // Given a prepared measurement object, measures the position of an
2418 // actual character (or fetches it from the cache).

Callers 6

measureCharFunction · 0.85
cursorCoordsFunction · 0.85
wrappedLineExtentCharFunction · 0.85
coordsCharInnerFunction · 0.85
endOfLineFunction · 0.85
getWrappedLineExtentFunction · 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