Repo // Clang-format.
This commit is contained in:
parent
e0762339ef
commit
7d6ac3cd5f
|
@ -40,6 +40,7 @@ extension KeyHandler {
|
|||
stateCallback: @escaping (InputStateProtocol) -> Void,
|
||||
errorCallback: @escaping () -> Void
|
||||
) -> Bool? {
|
||||
guard [.ofInputting, .ofEmpty, .ofEmptyIgnoringPreviousState].contains(state.type) else { return nil }
|
||||
|
||||
// MARK: 注音按鍵輸入處理 (Handle BPMF Keys)
|
||||
|
||||
|
|
|
@ -159,8 +159,8 @@ extension KeyHandler {
|
|||
// MARK: 注音按鍵輸入處理 (Handle BPMF Keys)
|
||||
|
||||
if let compositionHandled = handleComposition(
|
||||
input: input, state: state, stateCallback: stateCallback, errorCallback: errorCallback)
|
||||
{
|
||||
input: input, state: state, stateCallback: stateCallback, errorCallback: errorCallback
|
||||
) {
|
||||
return compositionHandled
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ extension vChewing {
|
|||
do {
|
||||
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
|
||||
strData = strData.replacingOccurrences(of: "\r", with: "\n")
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
strData.ranges(splitBy: "\n").filter { !$0.isEmpty }.forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2 {
|
||||
let theKey = String(neta[0])
|
||||
|
|
|
@ -87,7 +87,7 @@ extension vChewing {
|
|||
do {
|
||||
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
|
||||
strData = strData.replacingOccurrences(of: "\r", with: "\n")
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
strData.ranges(splitBy: "\n").filter { !$0.isEmpty }.forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2, String(neta[0]).first != "#" {
|
||||
if !neta[0].isEmpty, !neta[1].isEmpty {
|
||||
|
|
|
@ -53,7 +53,7 @@ extension vChewing {
|
|||
do {
|
||||
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
|
||||
strData = strData.replacingOccurrences(of: "\r", with: "\n")
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
strData.ranges(splitBy: "\n").filter { !$0.isEmpty }.forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2 {
|
||||
let theKey = String(neta[0])
|
||||
|
|
|
@ -107,12 +107,13 @@ public class ctlCandidate: NSWindowController, ctlCandidateProtocol {
|
|||
}
|
||||
}
|
||||
|
||||
required public init(_ layout: CandidateLayout = .horizontal) {
|
||||
public required init(_: CandidateLayout = .horizontal) {
|
||||
super.init(window: .init())
|
||||
visible = false
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@available(*, unavailable)
|
||||
required init?(coder _: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ public class ctlCandidateUniversal: ctlCandidate {
|
|||
}
|
||||
}
|
||||
|
||||
required public init(_ layout: CandidateLayout = .horizontal) {
|
||||
public required init(_ layout: CandidateLayout = .horizontal) {
|
||||
var contentRect = NSRect(x: 128.0, y: 128.0, width: 0.0, height: 0.0)
|
||||
let styleMask: NSWindow.StyleMask = [.nonactivatingPanel]
|
||||
let panel = NSPanel(
|
||||
|
@ -449,7 +449,7 @@ public class ctlCandidateUniversal: ctlCandidate {
|
|||
// MARK: Post-Init()
|
||||
|
||||
super.init(layout)
|
||||
self.window = panel
|
||||
window = panel
|
||||
currentLayout = layout
|
||||
|
||||
candidateView.target = self
|
||||
|
|
|
@ -57,13 +57,13 @@ class ctlAboutWindow: NSWindowController {
|
|||
)
|
||||
}
|
||||
|
||||
@IBAction func btnBugReport(_ sender: NSButton) {
|
||||
@IBAction func btnBugReport(_: NSButton) {
|
||||
if let url = URL(string: "https://vchewing.github.io/BUGREPORT.html") {
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func btnWebsite(_ sender: NSButton) {
|
||||
@IBAction func btnWebsite(_: NSButton) {
|
||||
if let url = URL(string: "https://vchewing.github.io/") {
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
|
|
|
@ -388,7 +388,8 @@ extension ctlPrefWindow: NSToolbarDelegate {
|
|||
item.label = title
|
||||
if #available(macOS 11.0, *) {
|
||||
item.image = NSImage(
|
||||
systemSymbolName: "wrench.and.screwdriver.fill", accessibilityDescription: "General Preferences")
|
||||
systemSymbolName: "wrench.and.screwdriver.fill", accessibilityDescription: "General Preferences"
|
||||
)
|
||||
} else {
|
||||
item.image = NSImage(named: NSImage.homeTemplateName)
|
||||
}
|
||||
|
@ -399,7 +400,8 @@ extension ctlPrefWindow: NSToolbarDelegate {
|
|||
item.label = title
|
||||
if #available(macOS 11.0, *) {
|
||||
item.image = NSImage(
|
||||
systemSymbolName: "person.fill.questionmark", accessibilityDescription: "Experiences Preferences")
|
||||
systemSymbolName: "person.fill.questionmark", accessibilityDescription: "Experiences Preferences"
|
||||
)
|
||||
} else {
|
||||
item.image = NSImage(named: NSImage.flowViewTemplateName)
|
||||
}
|
||||
|
@ -410,7 +412,8 @@ extension ctlPrefWindow: NSToolbarDelegate {
|
|||
item.label = title
|
||||
if #available(macOS 11.0, *) {
|
||||
item.image = NSImage(
|
||||
systemSymbolName: "character.book.closed.fill", accessibilityDescription: "Dictionary Preferences")
|
||||
systemSymbolName: "character.book.closed.fill", accessibilityDescription: "Dictionary Preferences"
|
||||
)
|
||||
} else {
|
||||
item.image = NSImage(named: NSImage.bookmarksTemplateName)
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ import Cocoa
|
|||
)
|
||||
}
|
||||
|
||||
@IBAction func btnWebsite(_ sender: NSButton) {
|
||||
@IBAction func btnWebsite(_: NSButton) {
|
||||
if let url = URL(string: "https://vchewing.github.io/") {
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
|
|
|
@ -357,7 +357,7 @@ extension String {
|
|||
|
||||
extension vChewing.LMAssociates {
|
||||
public mutating func forceOpenStringInstead(_ strData: String) {
|
||||
strData.ranges(splitBy: "\n").filter({ !$0.isEmpty }).forEach {
|
||||
strData.ranges(splitBy: "\n").filter { !$0.isEmpty }.forEach {
|
||||
let neta = strData[$0].split(separator: " ")
|
||||
if neta.count >= 2 {
|
||||
let theKey = String(neta[0])
|
||||
|
|
Loading…
Reference in New Issue