(view: EditorView)
| 151 | }); |
| 152 | |
| 153 | function highlightLines(view: EditorView) { |
| 154 | let highlightRange = view.state.facet(highlightedRange); |
| 155 | let builder = new RangeSetBuilder(); |
| 156 | for (let { from, to } of view.visibleRanges) { |
| 157 | for (let pos = from; pos <= to; ) { |
| 158 | let line = view.state.doc.lineAt(pos); |
| 159 | if ( |
| 160 | line.number >= highlightRange.from && |
| 161 | line.number <= highlightRange.to |
| 162 | ) { |
| 163 | builder.add(line.from, line.from, lineHighlightDecoration); |
| 164 | } |
| 165 | pos = line.to + 1; |
| 166 | } |
| 167 | } |
| 168 | return builder.finish(); |
| 169 | } |
| 170 | |
| 171 | const highlightLineRangePlugin = ViewPlugin.fromClass( |
| 172 | class { |
no outgoing calls
no test coverage detected