File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ enum UpdateLocationStrategy {
8080 tabFrame: CGRect ,
8181 alignPanelTopToAnchor: Bool
8282 ) {
83+ let preferredInsideEditorMinWidth = 1400 as Double
84+
8385 let maxY = max (
8486 y,
8587 mainScreen. frame. height - editorFrame. maxY + Style. widgetPadding,
@@ -101,7 +103,10 @@ enum UpdateLocationStrategy {
101103
102104 let proposedPanelX = proposedAnchorFrameOnTheRightSide. maxX + Style
103105 . widgetPadding * 2
104- let putPanelToTheRight = activeScreen. frame. maxX > proposedPanelX + Style. panelWidth
106+ let putPanelToTheRight = {
107+ if editorFrame. size. width >= preferredInsideEditorMinWidth { return false }
108+ return activeScreen. frame. maxX > proposedPanelX + Style. panelWidth
109+ } ( )
105110 let alignPanelTopToAnchor = fixedAlignment ?? ( y > activeScreen. frame. midY)
106111
107112 if putPanelToTheRight {
@@ -132,7 +137,14 @@ enum UpdateLocationStrategy {
132137 )
133138 let proposedPanelX = proposedAnchorFrameOnTheLeftSide. minX - Style
134139 . widgetPadding * 2 - Style. panelWidth
135- let putAnchorToTheLeft = proposedPanelX > activeScreen. frame. minX
140+ let putAnchorToTheLeft = {
141+ if editorFrame. size. width >= preferredInsideEditorMinWidth {
142+ if editorFrame. maxX <= activeScreen. frame. maxX {
143+ return false
144+ }
145+ }
146+ return proposedPanelX > activeScreen. frame. minX
147+ } ( )
136148
137149 if putAnchorToTheLeft {
138150 let anchorFrame = proposedAnchorFrameOnTheLeftSide
You can’t perform that action at this time.
0 commit comments