Scratch: associate inlay with preceding text

This allow to avoid some unintentional movements of caret after inserting scratch output
This commit is contained in:
Natalia Selezneva
2019-01-17 10:42:41 +03:00
parent 290ae16235
commit 76b06cd747
3 changed files with 7 additions and 3 deletions
@@ -74,7 +74,11 @@ object InlayScratchOutputHandler : ScratchOutputHandler {
if (shortText != text) { if (shortText != text) {
printToToolWindow(file, expression, output) printToToolWindow(file, expression, output)
} }
editor.inlayModel.addInlineElement(lineEndOffset, InlayScratchFileRenderer(" ".repeat(spaceCount) + shortText, output.type)) editor.inlayModel.addInlineElement(
lineEndOffset,
true,
InlayScratchFileRenderer(" ".repeat(spaceCount) + shortText, output.type)
)
} }
val existing = editor.inlayModel val existing = editor.inlayModel