MCPcopy Create free account
hub / github.com/breck7/scroll / prepareMeasureForLine

Function prepareMeasureForLine

external/.scrollLibs.js:3657–3680  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

3655 // measurements in a row, can thus ensure that the set-up work is
3656 // only done once.
3657 function prepareMeasureForLine(cm, line) {
3658 var lineN = lineNo(line)
3659 var view = findViewForLine(cm, lineN)
3660 if (view && !view.text) {
3661 view = null
3662 } else if (view && view.changes) {
3663 updateLineForChanges(cm, view, lineN, getDimensions(cm))
3664 cm.curOp.forceUpdate = true
3665 }
3666 if (!view) {
3667 view = updateExternalMeasurement(cm, line)
3668 }
3669
3670 var info = mapFromLineView(view, line, lineN)
3671 return {
3672 line: line,
3673 view: view,
3674 rect: null,
3675 map: info.map,
3676 cache: info.cache,
3677 before: info.before,
3678 hasHeights: false
3679 }
3680 }
3681
3682 // Given a prepared measurement object, measures the position of an
3683 // 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