before the great git rework
This commit is contained in:
@@ -32,7 +32,7 @@ public final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
false
|
||||
}
|
||||
|
||||
/// ⌘Q asks about unsaved files in every window first, and writes each note and session before quitting.
|
||||
/// ⌘Q asks about unsaved files in every window first, and writes each session before quitting.
|
||||
public func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
|
||||
let models = WorkspaceRegistry.models
|
||||
guard !models.isEmpty else { return .terminateNow }
|
||||
|
||||
@@ -47,8 +47,6 @@ public enum Command: Equatable, Sendable {
|
||||
|
||||
/// ⌘F; the seed is the first line of the current selection.
|
||||
case showSearch(seed: String)
|
||||
/// ⌘N
|
||||
case showNote
|
||||
/// `?`
|
||||
case showShortcuts
|
||||
/// ⇧⌘O: the other recent projects.
|
||||
@@ -57,7 +55,7 @@ public enum Command: Equatable, Sendable {
|
||||
case showRecentFiles(initialSelection: Int)
|
||||
/// Right-click or ⌘→ on a row; `anchor` is in window coordinates.
|
||||
case showContextMenu(ContextTarget, anchor: CGPoint)
|
||||
/// Esc: closes the one open overlay, with its own close behaviour (the note saves, Diff restores the mode).
|
||||
/// Esc: closes the one open overlay, with its own close behaviour (Diff restores the mode).
|
||||
case dismissOverlay
|
||||
/// The confirm overlay's yes.
|
||||
case confirmPending
|
||||
@@ -119,11 +117,6 @@ public enum Command: Equatable, Sendable {
|
||||
/// ⌘C without a selection, outside a terminal
|
||||
case focusCommitMessage
|
||||
|
||||
// MARK: Note
|
||||
|
||||
/// ⌘P while the note is open.
|
||||
case passNote
|
||||
|
||||
// MARK: Clean copy
|
||||
|
||||
/// The clean-copy popup's Copy and ⌘↩: copies its text and closes it.
|
||||
|
||||
@@ -90,8 +90,6 @@ struct HelderCommands: Commands {
|
||||
Divider()
|
||||
Button("Search") { workspace?.perform(.showSearch(seed: "")) }
|
||||
.keyboardShortcut("f", modifiers: .command)
|
||||
Button("Project Note") { workspace?.perform(.showNote) }
|
||||
.keyboardShortcut("n", modifiers: .command)
|
||||
Button("Keyboard Shortcuts") { workspace?.perform(.showShortcuts) }
|
||||
Divider()
|
||||
Button("Actual Size") { workspace?.perform(.zoom(.reset)) }
|
||||
|
||||
@@ -76,7 +76,6 @@ public struct KeyContext: Equatable, Sendable {
|
||||
/// The overlay kinds the router tells apart.
|
||||
public enum OverlayKind: Equatable, Sendable {
|
||||
case none
|
||||
case note
|
||||
/// The full-screen Diff: the workspace shortcuts keep working over it. `busy` while its own
|
||||
/// menu or pass-on prompt is open; those then own every key.
|
||||
case diff(busy: Bool)
|
||||
@@ -86,7 +85,6 @@ public enum OverlayKind: Equatable, Sendable {
|
||||
public init(_ overlay: Overlay, diffBusy: Bool = false) {
|
||||
switch overlay {
|
||||
case .none: self = .none
|
||||
case .note: self = .note
|
||||
case .diff: self = .diff(busy: diffBusy)
|
||||
default: self = .other
|
||||
}
|
||||
@@ -116,8 +114,6 @@ public enum KeyRouter {
|
||||
case .none: break
|
||||
case .diff:
|
||||
if press == .cmd(.character("a")) { return .pass }
|
||||
case .note:
|
||||
return press == .cmd(.character("p")) ? .perform(.passNote) : .pass
|
||||
case .other: return .pass
|
||||
}
|
||||
|
||||
@@ -177,7 +173,6 @@ public enum KeyRouter {
|
||||
switch c {
|
||||
case "f": return .perform(.showSearch(seed: context.searchSeed))
|
||||
case "p": return .perform(.push)
|
||||
case "n": return .perform(.showNote)
|
||||
case "s": return .perform(.save)
|
||||
case "m": return .perform(.cycleMode)
|
||||
case "w": return .perform(.closeFileOrWindow)
|
||||
|
||||
@@ -131,7 +131,7 @@ private struct PaneToggles: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Search ⌘F · Fluid ⌘L · Hidden ⌘. · Note ⌘N, then `?`. Search and Note are actions; Fluid and Hidden toggle.
|
||||
/// Search ⌘F · Fluid ⌘L · Hidden ⌘., then `?`. Search is an action; Fluid and Hidden toggle.
|
||||
/// While Helder reads aloud, a Stop toggle leads the group; switching it off stops the reading.
|
||||
private struct TitleToolbar: View {
|
||||
let model: WorkspaceModel
|
||||
@@ -154,8 +154,6 @@ private struct TitleToolbar: View {
|
||||
: Tooltip.stated("Hidden files: ", "hidden", " — dotfiles are excluded from the tree and the search. Click to show them.")) {
|
||||
model.perform(.toggleHidden)
|
||||
},
|
||||
GroupItem("Note", keys: "⌘N", kind: .action,
|
||||
tip: Text("Project note (.notes.txt) — kept next to this project.")) { model.perform(.showNote) },
|
||||
], tipEdge: .trailing)
|
||||
ToolbarIconButton("?") { model.perform(.showShortcuts) }
|
||||
.tip("Keyboard shortcuts.", edge: .trailing)
|
||||
|
||||
@@ -74,7 +74,7 @@ final class WindowCoordinator: NSObject {
|
||||
window.delegate = closeGuard
|
||||
}
|
||||
|
||||
/// The first close only asks: unsaved files prompt, the note and session are written, then the window closes.
|
||||
/// The first close only asks: unsaved files prompt, the session is written, then the window closes.
|
||||
private func shouldClose(_ window: NSWindow) -> Bool {
|
||||
if closeApproved { return true }
|
||||
guard !isAskingToClose else { return false }
|
||||
|
||||
Reference in New Issue
Block a user