mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 09:03:31 +07:00
[terminal] IJPL-213971 Fix exceptions caused by out-of-bounds offsets in TerminalBlocksDecorator
Always check that block start offset is in the model bounds. GitOrigin-RevId: 4ed08212375b2fdb75c4c0e0ad9f5207c8240a4d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ee118062e5
commit
f71b4cbc5a
+2
-2
@@ -93,7 +93,7 @@ internal class TerminalBlocksDecorator(
|
||||
}
|
||||
|
||||
private fun createPromptDecoration(block: TerminalCommandBlock): BlockDecoration {
|
||||
val startOffset = block.startOffset
|
||||
val startOffset = block.startOffset.coerceAtLeast(outputModel.startOffset)
|
||||
val endOffset = block.endOffset
|
||||
|
||||
val topInlay = createTopInlay(block)
|
||||
@@ -111,7 +111,7 @@ internal class TerminalBlocksDecorator(
|
||||
}
|
||||
|
||||
private fun createFinishedBlockDecoration(block: TerminalCommandBlock): BlockDecoration {
|
||||
val startOffset = block.startOffset
|
||||
val startOffset = block.startOffset.coerceAtLeast(outputModel.startOffset)
|
||||
// End offset of the finished block is located after the line break.
|
||||
// But we need to place the end inlay before the line break and limit the height of the highlighters to the block content.
|
||||
// So adjust the offset by 1.
|
||||
|
||||
Reference in New Issue
Block a user