MCPcopy Index your code
hub / github.com/cedaro/shiny-code / highlightLines

Method highlightLines

blocks/code/code-editor.js:68–75  ·  view source on GitHub ↗
( lines, prevLines = [] )

Source from the content-addressed store, hash-verified

66 }
67
68 highlightLines( lines, prevLines = [] ) {
69 const doc = this.editor.codemirror;
70 const className = 'CodeMirror-linebackground-highlight';
71 const arrayDifference = ( array1, array2 ) => array1.filter( value => ! array2.includes( value ) );
72
73 lines.forEach( line => doc.addLineClass( line, 'background', className ) );
74 arrayDifference( prevLines, lines ).forEach( line => doc.removeLineClass( line, 'background', className ) );
75 }
76
77 updateLanguageSettings( value ) {
78 const settings = getLanguageSettings( value );

Callers 2

componentDidMountMethod · 0.95
componentDidUpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected