Skip to content

Commit

Permalink
Isolate focusing in SVCodeInput class
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 14, 2021
1 parent a283b9f commit 77da0a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions Blink/SmarterKeys/SmarterTermInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,6 @@ extension SmarterTermInput {
}
}

override func canBeFocused() -> Bool {
let res = super.canBeFocused()

if res == false {
return KBTracker.shared.input == self
}

return res
}

override func onMods() {
kbView.stopRepeats()
}
Expand Down Expand Up @@ -564,3 +554,15 @@ extension SmarterTermInput: TermInput {
}

}

class VSCodeInput: SmarterTermInput {
override func canBeFocused() -> Bool {
let res = super.canBeFocused()

if res == false {
return KBTracker.shared.input == self
}

return res
}
}
2 changes: 1 addition & 1 deletion Blink/TermView.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ - (void)addBrowserWebView:(NSURL *)url agent: (NSString *)agent
// configuration.limitsNavigationsToAppBoundDomains = YES;


_browserView = [[SmarterTermInput alloc] initWithFrame:[self webViewFrame] configuration:configuration];
_browserView = [[VSCodeInput alloc] initWithFrame:[self webViewFrame] configuration:configuration];
_browserView.customUserAgent =
// [@"Mozilla/5.0 (Linux; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15 " stringByAppendingString:agent];
[@"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15 " stringByAppendingString:agent];
Expand Down

0 comments on commit 77da0a2

Please sign in to comment.