IME // Tweaking isPrintable().

This commit is contained in:
ShikiSuen 2022-07-06 12:32:33 +08:00
parent 42cc923425
commit 632739e39f
3 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ extension KeyHandler {
var cleanedComposition = ""
for theChar in composedText {
if let charCode = theChar.utf16.first {
if !(theChar.isASCII && !(charCode.isPrintable())) {
if !(theChar.isASCII && !(charCode.isPrintable)) {
cleanedComposition += String(theChar)
}
}

View File

@ -210,7 +210,7 @@ class ctlInputMethod: IMKInputController {
//
// KeyHandler
if !input.charCode.isPrintable() {
if !input.charCode.isPrintable {
return false
}

View File

@ -413,7 +413,7 @@ extension String {
// Ref: https://forums.swift.org/t/57085/5
extension UniChar {
public func isPrintable() -> Bool {
public var isPrintable: Bool {
guard Unicode.Scalar(UInt32(self)) != nil else {
struct NotAWholeScalar: Error {}
return false