Thou shalt not cross 80 columns in thy file.

This commit is contained in:
2025-03-20 13:06:24 -07:00
parent 1a3e52efc8
commit ef4d469941
16 changed files with 640 additions and 263 deletions

View File

@@ -15,23 +15,33 @@ final class EditableNSTextField: NSTextField {
if event.type == NSEvent.EventType.keyDown {
if modsContains(keys: OSCmd, in: modifiers) {
if key == kVK_ANSI_X {
if NSApp.sendAction(#selector(NSText.cut(_:)), to: nil, from: self) {
if NSApp.sendAction(#selector(NSText.cut(_:)), to: nil,
from: self)
{
return true
}
} else if key == kVK_ANSI_C {
if NSApp.sendAction(#selector(NSText.copy(_:)), to: nil, from: self) {
if NSApp.sendAction(#selector(NSText.copy(_:)), to: nil,
from: self)
{
return true
}
} else if key == kVK_ANSI_V {
if NSApp.sendAction(#selector(NSText.paste(_:)), to: nil, from: self) {
if NSApp.sendAction(#selector(NSText.paste(_:)), to: nil,
from: self)
{
return true
}
} else if key == kVK_ANSI_Z {
if NSApp.sendAction(Selector(("undo:")), to: nil, from: self) {
if NSApp.sendAction(Selector(("undo:")), to: nil,
from: self)
{
return true
}
} else if key == kVK_ANSI_A {
if NSApp.sendAction(#selector(NSResponder.selectAll(_:)), to: nil, from: self) {
if NSApp.sendAction(#selector(NSResponder.selectAll(_:)),
to: nil, from: self)
{
return true
}
} else if isNumericalCode(key) { // Ignore Command + {1-9}.
@@ -39,7 +49,9 @@ final class EditableNSTextField: NSTextField {
}
} else if modsContains(keys: OSCmd | OSShift, in: modifiers) {
if key == kVK_ANSI_Z {
if NSApp.sendAction(Selector(("redo:")), to: nil, from: self) {
if NSApp.sendAction(Selector(("redo:")), to: nil,
from: self)
{
return true
}
}