mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
fix: keyword highlighting causes crash
This commit is contained in:
@@ -101,6 +101,16 @@ internal class KeywordHighlightPaintListener private constructor() : TerminalPai
|
||||
// -1 表示不使用高亮集
|
||||
if (keywordHighlightSetId == "-1") return
|
||||
|
||||
try {
|
||||
doFind(offset, count, terminal, keywordHighlightSetId)
|
||||
} catch (e: Exception) {
|
||||
if (log.isDebugEnabled) {
|
||||
log.debug(e.message, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun doFind(offset: Int, count: Int, terminal: Terminal, keywordHighlightSetId: String) {
|
||||
for (highlight in keywordHighlights) {
|
||||
if (highlight.enabled.not()) continue
|
||||
if (highlight.type != KeywordHighlightType.Highlight) continue
|
||||
@@ -151,7 +161,6 @@ internal class KeywordHighlightPaintListener private constructor() : TerminalPai
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun after(
|
||||
|
||||
Reference in New Issue
Block a user