MCPcopy Create free account
hub / github.com/TruthHun/BookStack / getLineStyles

Function getLineStyles

static/mergely/lib/codemirror.js:6872–6883  ·  view source on GitHub ↗
(cm, line, updateFrontier)

Source from the content-addressed store, hash-verified

6870 }
6871
6872 function getLineStyles(cm, line, updateFrontier) {
6873 if (!line.styles || line.styles[0] != cm.state.modeGen) {
6874 var state = getStateBefore(cm, lineNo(line));
6875 var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state);
6876 line.stateAfter = state;
6877 line.styles = result.styles;
6878 if (result.classes) line.styleClasses = result.classes;
6879 else if (line.styleClasses) line.styleClasses = null;
6880 if (updateFrontier === cm.doc.frontier) cm.doc.frontier++;
6881 }
6882 return line.styles;
6883 }
6884
6885 // Lightweight form of highlight -- proceed over this line and
6886 // update state, but don't save a style array. Used for lines that

Callers 2

codemirror.jsFile · 0.70
buildLineContentFunction · 0.70

Calls 4

copyStateFunction · 0.85
getStateBeforeFunction · 0.70
lineNoFunction · 0.70
highlightLineFunction · 0.70

Tested by

no test coverage detected