File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
MarkEditMac/Modules/Sources/TextCompletion Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,11 @@ public final class TextCompletionContext {
7272 origin. x = parentWindow. frame. size. width - panelPadding - panelSize. width
7373 }
7474
75+ let screenY = parentWindow. convertPoint ( toScreen: origin) . y
76+ let dockHeight = ( parentWindow. screen ?? NSScreen . main) ? . dockHeight ?? 0
77+
7578 // Too close to the bottom, or was already upside down during one typing session
76- if ( origin . y - panelPadding < 0 ) || wasFlipped {
79+ if ( screenY - dockHeight - panelPadding < 0 ) || wasFlipped {
7780 origin. y = parentWindow. frame. height - caretRect. minY - safeArea + caretPadding
7881 wasFlipped = true
7982 }
@@ -114,3 +117,11 @@ public final class TextCompletionContext {
114117 private let localizable : TextCompletionLocalizable
115118 private let commitCompletion : @Sendable ( ) -> Void
116119}
120+
121+ // MARK: - Private
122+
123+ private extension NSScreen {
124+ var dockHeight : Double {
125+ frame. height - visibleFrame. height
126+ }
127+ }
You can’t perform that action at this time.
0 commit comments