You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/InlineChatEditorHint.kt
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -19,23 +19,26 @@ import javax.swing.JPanel
19
19
20
20
classInlineChatEditorHint {
21
21
privateval hint = createHint()
22
+
privateval hintXOffset =20
22
23
23
24
privatefungetHintLocation(editor:Editor): Point {
24
25
val range = editor.calculateVisibleRange()
25
26
val document = editor.document
26
27
val selectionEnd = editor.selectionModel.selectionEnd
27
28
val isOneLineSelection = isOneLineSelection(editor)
28
-
val isBelow = editor.offsetToXY(selectionEnd) !in editor.scrollingModel.visibleArea
29
+
val offset = document.getLineEndOffset(document.getLineNumber(selectionEnd))
30
+
val offsetXy = editor.offsetToXY(offset)
31
+
val potentialXy =Point(offsetXy.x + hintXOffset, offsetXy.y)
32
+
val isBelow = potentialXy !in editor.scrollingModel.visibleArea
29
33
val areEdgesOutsideOfVisibleArea = editor.selectionModel.selectionStart !in range && editor.selectionModel.selectionEnd !in range
0 commit comments