File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Service/SuggestionCommandHandler Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ public extension AXUIElement {
1111 var value : String {
1212 ( try ? copyValue ( key: kAXValueAttribute) ) ?? " "
1313 }
14+
15+ var doubleValue : Double {
16+ ( try ? copyValue ( key: kAXValueAttribute) ) ?? 0.0
17+ }
1418
1519 var document : String ? {
1620 try ? copyValue ( key: kAXDocumentAttribute)
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ struct PseudoCommandHandler {
9595 ) ) else { return }
9696
9797 let oldPosition = focusElement. selectedTextRange
98+ let oldScrollPosition = focusElement. parent? . verticalScrollBar? . doubleValue
9899
99100 let error = AXUIElementSetAttributeValue (
100101 focusElement,
@@ -130,6 +131,14 @@ struct PseudoCommandHandler {
130131 }
131132 }
132133
134+ if let oldScrollPosition, let scrollBar = focusElement. parent? . verticalScrollBar {
135+ AXUIElementSetAttributeValue (
136+ scrollBar,
137+ kAXValueAttribute as CFString ,
138+ oldScrollPosition as CFTypeRef
139+ )
140+ }
141+
133142 } catch {
134143 PresentInWindowSuggestionPresenter ( ) . presentError ( error)
135144 }
You can’t perform that action at this time.
0 commit comments