|
|
@ -42,20 +42,24 @@ class SourceHighlighter { |
|
|
|
this._deps.fileManager.switchFile(this.source) |
|
|
|
this._deps.fileManager.switchFile(this.source) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const backgoundClass = style || 'alert-info' |
|
|
|
|
|
|
|
const css = csjs` |
|
|
|
const css = csjs` |
|
|
|
.highlightcode { |
|
|
|
.highlightcode { |
|
|
|
position:absolute; |
|
|
|
position:absolute; |
|
|
|
z-index:20; |
|
|
|
z-index:20; |
|
|
|
|
|
|
|
background-color: ${style || 'var(--info)'}; |
|
|
|
} |
|
|
|
} |
|
|
|
.highlightcode_fullLine { |
|
|
|
.highlightcode_fullLine { |
|
|
|
position:absolute; |
|
|
|
position:absolute; |
|
|
|
z-index:20; |
|
|
|
z-index:20; |
|
|
|
opacity: 0.5; |
|
|
|
opacity: 0.5; |
|
|
|
|
|
|
|
background-color: ${style || 'var(--info)'}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.customBackgroundColor { |
|
|
|
|
|
|
|
background-color: ${style || 'var(--info)'}; |
|
|
|
} |
|
|
|
} |
|
|
|
` |
|
|
|
` |
|
|
|
|
|
|
|
|
|
|
|
this.statementMarker = this._deps.editor.addMarker(lineColumnPos, this.source, css.highlightcode + ' ' + backgoundClass) |
|
|
|
this.statementMarker = this._deps.editor.addMarker(lineColumnPos, this.source, css.highlightcode.className + ' ' + css.customBackgroundColor.className) |
|
|
|
this._deps.editor.scrollToLine(lineColumnPos.start.line, true, true, function () {}) |
|
|
|
this._deps.editor.scrollToLine(lineColumnPos.start.line, true, true, function () {}) |
|
|
|
|
|
|
|
|
|
|
|
if (lineColumnPos.start.line === lineColumnPos.end.line) { |
|
|
|
if (lineColumnPos.start.line === lineColumnPos.end.line) { |
|
|
@ -68,7 +72,7 @@ class SourceHighlighter { |
|
|
|
line: lineColumnPos.start.line + 1, |
|
|
|
line: lineColumnPos.start.line + 1, |
|
|
|
column: 0 |
|
|
|
column: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
}, this.source, css.highlightcode_fullLine) |
|
|
|
}, this.source, css.highlightcode_fullLine.className) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|