This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
editor/src/main/java/com/itsaky/androidide/editor/ui Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1717
1818package com.itsaky.androidide.editor.ui
1919
20+ import com.itsaky.androidide.utils.ILogger
2021import io.github.rosemoe.sora.widget.CodeEditor
2122import io.github.rosemoe.sora.widget.base.EditorPopupWindow
2223
@@ -28,8 +29,17 @@ import io.github.rosemoe.sora.widget.base.EditorPopupWindow
2829abstract class AbstractPopupWindow (editor : CodeEditor , features : Int ) :
2930 EditorPopupWindow (editor, features) {
3031
32+ companion object {
33+ private val log = ILogger .newInstance(" AbstractPopupWindow" )
34+ }
35+
3136 override fun show () {
3237 (editor as ? IDEEditor )?.ensureWindowsDismissed()
38+ if (! editor.isAttachedToWindow) {
39+ log.error(" Trying to show popup window '${javaClass.name} ' when editor is not attached to window" )
40+ return
41+ }
42+
3343 super .show()
3444 }
3545
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ import kotlin.math.min
6969 * @author Akash Yadav
7070 */
7171@SuppressLint(" RestrictedApi" )
72- open class EditorActionsMenu constructor (val editor : IDEEditor ) :
72+ open class EditorActionsMenu (val editor : IDEEditor ) :
7373 AbstractPopupWindow (editor, FEATURE_SHOW_OUTSIDE_VIEW_ALLOWED ),
7474 ActionsRegistry .ActionExecListener ,
7575 MenuBuilder .Callback {
You can’t perform that action at this time.
0 commit comments