Enabled always verify autotype match settings. UI is missing for this setting

This commit is contained in:
Michael Starke
2020-11-04 18:25:32 +01:00
parent 8e3bca062b
commit c0a64a1bc3
5 changed files with 78 additions and 63 deletions

View File

@@ -289,10 +289,15 @@ static MPAutotypeDaemon *_sharedInstance;
[autotypeCandidates addObjectsFromArray:contexts];
}
}
BOOL isGlobalAutotype = (environment.preferredEntry == nil);
BOOL alwaysShowCandidateSelection = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection];
if(autotypeCandidates.count <= 1) {
return autotypeCandidates.lastObject;
/* if we have only one candidate and do not need to show the windows, return only the last candiadate */
if(autotypeCandidates.count <= 1 && !(isGlobalAutotype && alwaysShowCandidateSelection)) {
return autotypeCandidates.lastObject;
}
/* otherwise show the candidate selection window */
[self _presentCandiadates:autotypeCandidates forEnvironment:environment];
return nil; // Nothing to do, we get called back by the window
}