mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[terminal] Refactoring: Extract Document.clearGuardedBlocks()
GitOrigin-RevId: e9532ef212be6bcf6328d169978f0473825e4c46
This commit is contained in:
committed by
intellij-monorepo-bot
parent
87661e68a4
commit
09e0eeb9a5
+5
-1
@@ -96,7 +96,7 @@ internal class TerminalPromptModelImpl(
|
||||
@RequiresEdt
|
||||
private fun doUpdatePrompt(renderingInfo: TerminalPromptRenderingInfo) {
|
||||
DocumentUtil.writeInRunUndoTransparentAction {
|
||||
document.guardedBlocks.forEach { document.removeGuardedBlock(it) }
|
||||
document.clearGuardedBlocks()
|
||||
document.replaceString(0, commandStartOffset, renderingInfo.text)
|
||||
document.createGuardedBlock(0, renderingInfo.text.length)
|
||||
}
|
||||
@@ -175,5 +175,9 @@ internal class TerminalPromptModelImpl(
|
||||
addRangeHighlighter(highlighting.startOffset, highlighting.endOffset, HighlighterLayer.SYNTAX,
|
||||
highlighting.textAttributesProvider.getTextAttributes(), HighlighterTargetArea.EXACT_RANGE)
|
||||
}
|
||||
|
||||
private fun DocumentEx.clearGuardedBlocks() {
|
||||
this.guardedBlocks.forEach { removeGuardedBlock(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user