Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit c894d3d

Browse files
committed
fix: ignore completion requests when editor is not attached to window (fixes #1739)
1 parent ec9d944 commit c894d3d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

editor/src/main/java/com/itsaky/androidide/editor/ui/EditorCompletionWindow.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import com.itsaky.androidide.utils.KeyboardUtils
2727
import io.github.rosemoe.sora.lang.completion.CompletionItem
2828
import io.github.rosemoe.sora.widget.component.CompletionLayout
2929
import io.github.rosemoe.sora.widget.component.EditorAutoCompletion
30-
import io.github.rosemoe.sora.widget.getComponent
3130
import java.lang.ref.WeakReference
3231
import kotlin.math.min
3332

@@ -103,7 +102,7 @@ class EditorCompletionWindow(val editor: IDEEditor) : EditorAutoCompletion(edito
103102
}
104103

105104
override fun requireCompletion() {
106-
if (cancelShowUp || !isEnabled) {
105+
if (cancelShowUp || !isEnabled || !editor.isAttachedToWindow) {
107106
return
108107
}
109108

0 commit comments

Comments
 (0)