Scratch: associate inlay with preceding text
This allow to avoid some unintentional movements of caret after inserting scratch output
This commit is contained in:
+5
-1
@@ -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
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
foo()
|
foo()
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ val a = "a".repeat(100)
|
|||||||
a
|
a
|
||||||
val b = "0123456789\n".repeat(10)
|
val b = "0123456789\n".repeat(10)
|
||||||
b
|
b
|
||||||
println("0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789")
|
println("0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789")
|
||||||
|
|||||||
Reference in New Issue
Block a user