This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree 2 files changed +11
-1
lines changed
editor/src/main/java/com/itsaky/androidide/editor/ui
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 17
17
18
18
package com.itsaky.androidide.editor.ui
19
19
20
+ import com.itsaky.androidide.utils.ILogger
20
21
import io.github.rosemoe.sora.widget.CodeEditor
21
22
import io.github.rosemoe.sora.widget.base.EditorPopupWindow
22
23
@@ -28,8 +29,17 @@ import io.github.rosemoe.sora.widget.base.EditorPopupWindow
28
29
abstract class AbstractPopupWindow (editor : CodeEditor , features : Int ) :
29
30
EditorPopupWindow (editor, features) {
30
31
32
+ companion object {
33
+ private val log = ILogger .newInstance(" AbstractPopupWindow" )
34
+ }
35
+
31
36
override fun show () {
32
37
(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
+
33
43
super .show()
34
44
}
35
45
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ import kotlin.math.min
69
69
* @author Akash Yadav
70
70
*/
71
71
@SuppressLint(" RestrictedApi" )
72
- open class EditorActionsMenu constructor (val editor : IDEEditor ) :
72
+ open class EditorActionsMenu (val editor : IDEEditor ) :
73
73
AbstractPopupWindow (editor, FEATURE_SHOW_OUTSIDE_VIEW_ALLOWED ),
74
74
ActionsRegistry .ActionExecListener ,
75
75
MenuBuilder .Callback {
You can’t perform that action at this time.
0 commit comments