toggling between views made possible
This commit is contained in:
@@ -34,6 +34,8 @@ public enum ContextAction: Sendable, Equatable {
|
||||
case newFolder(inDirectory: String)
|
||||
/// Opens a file from the Git view, which closes first.
|
||||
case openFile(String)
|
||||
/// Opens a file from the Git view on its Diff, which closes first.
|
||||
case openDiff(String)
|
||||
/// Reverts unstaged changes: modified and deleted files come back from the index, new files are removed.
|
||||
case gitDiscard([String])
|
||||
/// The Git view's Clean up: every unstaged change reverted to the index, every untracked file and folder removed.
|
||||
@@ -153,7 +155,11 @@ public enum ContextActions {
|
||||
let paste: [ContextMenuEntry] = kind == .tail ? [] : [.action(.pasteIntoTerminal(kind), label: "Paste")]
|
||||
return (hasSelection ? [.action(.copyTerminalSelection(kind), label: "Copy")] : []) + paste + readAloud + waitWhat
|
||||
case let .gitRow(path, isDeleted):
|
||||
let open: [ContextMenuEntry] = isDeleted ? [] : [.action(.openFile(path), label: "Open in editor"), .separator]
|
||||
let open: [ContextMenuEntry] = isDeleted ? [] : [
|
||||
.action(.openFile(path), label: "Open in editor"),
|
||||
.action(.openDiff(path), label: "Open diff"),
|
||||
.separator,
|
||||
]
|
||||
return open + [
|
||||
.action(.passOnReference(path, code: nil), label: "Pass on reference"),
|
||||
.action(.copyReference(path), label: "Copy reference"),
|
||||
|
||||
Reference in New Issue
Block a user