PhraseEditor // Allow calling TextEdit if the option key is pressed.

This commit is contained in:
ShikiSuen 2022-12-08 15:49:54 +08:00
parent 2c684a925c
commit 34e9ca9493
2 changed files with 4 additions and 2 deletions

View File

@ -187,7 +187,8 @@ public struct VwrPhraseEditorUI: View {
}
private func callExternalAppToOpenPhraseFile() {
delegate?.openPhraseFile(mode: selInputMode, type: selUserDataType, app: "Finder")
let app: String = NSEvent.modifierFlags.contains(.option) ? "TextEdit" : "Finder"
delegate?.openPhraseFile(mode: selInputMode, type: selUserDataType, app: app)
}
// MARK: - Main View.

View File

@ -190,7 +190,8 @@ extension CtlPrefWindow: NSTextViewDelegate, NSTextFieldDelegate {
@IBAction func openExternallyPEButtonClicked(_: NSButton) {
DispatchQueue.main.async { [self] in
LMMgr.shared.openPhraseFile(mode: selInputMode, type: selUserDataType, app: "Finder")
let app: String = NSEvent.modifierFlags.contains(.option) ? "TextEdit" : "Finder"
LMMgr.shared.openPhraseFile(mode: selInputMode, type: selUserDataType, app: app)
}
}