MCPcopy
hub / github.com/witheve/Eve / getLineStyles

Function getLineStyles

src/codemirror.js:6897–6908  ·  view source on GitHub ↗
(cm, line, updateFrontier)

Source from the content-addressed store, hash-verified

6895 }
6896
6897 function getLineStyles(cm, line, updateFrontier) {
6898 if (!line.styles || line.styles[0] != cm.state.modeGen) {
6899 var state = getStateBefore(cm, lineNo(line));
6900 var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state);
6901 line.stateAfter = state;
6902 line.styles = result.styles;
6903 if (result.classes) line.styleClasses = result.classes;
6904 else if (line.styleClasses) line.styleClasses = null;
6905 if (updateFrontier === cm.doc.frontier) cm.doc.frontier++;
6906 }
6907 return line.styles;
6908 }
6909
6910 // Lightweight form of highlight -- proceed over this line and
6911 // update state, but don't save a style array. Used for lines that

Callers 2

codemirror.jsFile · 0.85
buildLineContentFunction · 0.85

Calls 3

getStateBeforeFunction · 0.85
lineNoFunction · 0.85
highlightLineFunction · 0.85

Tested by

no test coverage detected