Fixing stuff
This commit is contained in:
@@ -6,7 +6,7 @@ import HelderCore
|
|||||||
/// first responder when it names them.
|
/// first responder when it names them.
|
||||||
public enum FocusTarget: Equatable, Sendable {
|
public enum FocusTarget: Equatable, Sendable {
|
||||||
case panel(Panel)
|
case panel(Panel)
|
||||||
/// ⌘C without a selection: the commit message field.
|
/// ⌘C without a selection, outside a terminal: the commit message field.
|
||||||
case commitMessage
|
case commitMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ public enum Command: Equatable, Sendable {
|
|||||||
case commit
|
case commit
|
||||||
/// ⌘P
|
/// ⌘P
|
||||||
case push
|
case push
|
||||||
/// ⌘C without a selection
|
/// ⌘C without a selection, outside a terminal
|
||||||
case focusCommitMessage
|
case focusCommitMessage
|
||||||
|
|
||||||
// MARK: Note
|
// MARK: Note
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ public enum KeyRouter {
|
|||||||
case ".": return .perform(.toggleHidden)
|
case ".": return .perform(.toggleHidden)
|
||||||
case "a": return context.owner == .workspace ? .perform(.selectAllInFile) : .pass
|
case "a": return context.owner == .workspace ? .perform(.selectAllInFile) : .pass
|
||||||
case "c":
|
case "c":
|
||||||
if context.hasTextSelection || context.hasEditorLineSelection { return .pass }
|
if context.owner == .terminal || context.hasTextSelection || context.hasEditorLineSelection { return .pass }
|
||||||
return .perform(.focusCommitMessage)
|
return .perform(.focusCommitMessage)
|
||||||
default: return .pass
|
default: return .pass
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ import Testing
|
|||||||
#expect(route(cmd("a"), KeyContext(owner: .terminal)) == .pass)
|
#expect(route(cmd("a"), KeyContext(owner: .terminal)) == .pass)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test func commandCFocusesTheCommitBoxUnlessThereIsSomethingToCopy() {
|
@Test func commandCFocusesTheCommitBoxOutsideTheTerminalUnlessThereIsSomethingToCopy() {
|
||||||
#expect(route(cmd("c")) == .perform(.focusCommitMessage))
|
#expect(route(cmd("c")) == .perform(.focusCommitMessage))
|
||||||
#expect(route(cmd("c"), KeyContext(owner: .text(in: .editor), hasTextSelection: true)) == .pass)
|
#expect(route(cmd("c"), KeyContext(owner: .text(in: .editor), hasTextSelection: true)) == .pass)
|
||||||
#expect(route(cmd("c"), KeyContext(hasEditorLineSelection: true)) == .pass)
|
#expect(route(cmd("c"), KeyContext(hasEditorLineSelection: true)) == .pass)
|
||||||
#expect(route(cmd("c"), KeyContext(owner: .terminal)) == .perform(.focusCommitMessage))
|
#expect(route(cmd("c"), KeyContext(owner: .terminal)) == .pass)
|
||||||
#expect(route(cmd("c"), KeyContext(owner: .terminal, hasTextSelection: true)) == .pass)
|
#expect(route(cmd("c"), KeyContext(owner: .terminal, hasTextSelection: true)) == .pass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ gets room:
|
|||||||
| `↵` | Open the selected row (search hit, file, recent project) |
|
| `↵` | Open the selected row (search hit, file, recent project) |
|
||||||
| `⌘→` (editor) | Pass the current selection to the agent |
|
| `⌘→` (editor) | Pass the current selection to the agent |
|
||||||
| `⌘M` | Markdown: code or rendered preview |
|
| `⌘M` | Markdown: code or rendered preview |
|
||||||
| `⌘C` / `⌘↵` / `⌘P` (git) | Focus commit message / commit staged / push branch |
|
| `⌘C` / `⌘↵` / `⌘P` (git) | Focus commit message (not from a terminal) / commit staged / push branch |
|
||||||
| `⌘A` | Toggle auto-fit panels (columns re-fit on resize and focus) |
|
| `⌘A` | Toggle auto-fit panels (columns re-fit on resize and focus) |
|
||||||
| `⌘.` | Toggle hidden dotfiles in tree and search |
|
| `⌘.` | Toggle hidden dotfiles in tree and search |
|
||||||
| `⌘G` | Show or hide the source-control column |
|
| `⌘G` | Show or hide the source-control column |
|
||||||
|
|||||||
Reference in New Issue
Block a user