summaryrefslogtreecommitdiff
path: root/src/plumbing
diff options
context:
space:
mode:
Diffstat (limited to 'src/plumbing')
-rw-r--r--src/plumbing30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/plumbing b/src/plumbing
index 74c1f306..4e8cd702 100644
--- a/src/plumbing
+++ b/src/plumbing
@@ -4,13 +4,24 @@
# hold takes it, and its actions say where it goes: a port pardes reads
# itself (edit: a file or directory opened as Look opens one; web: the
# host's browser; a loaded kind by its name, `image`, `pdf`), another
-# port a program reads, or a word or command started.
+# port a program reads, or a word or program started. One that none
+# takes is Look's own: a file or directory opened, else the word
+# searched for. A look sends what it looks at: type text, src pardes
+# (term from a terminal's raw mode, a kind's name from its pane), wdir
+# its pane's directory, data the name as Look reads it.
# urls go to the web browser (the host's: xdg-open, open on macOS)
type is text
data matches 'https?://.*'
plumb to web
+# a diff or patch looked at bare is stacked in a +Diff; one with no
+# hunk in it opens as text
+type is text
+data matches '.*\.(diff|patch)'
+arg isfile $data
+plumb start Diff $file
+
# existing directories, and existing files at the place written after
# them, go to the editor; a file a kind shows (a picture, a PDF) to
# that kind
@@ -21,3 +32,20 @@ plumb to edit
type is text
arg isfile $data
plumb to edit
+
+# a commit hash looked at in the editor, in a git work tree: git show,
+# stacked in a +Diff (outside one, Diff declines and the word is
+# searched for)
+type is text
+src is pardes
+data matches '[0-9a-f]{7,40}'
+data matches '[0-9a-f]*[0-9][0-9a-f]*'
+data matches '[0-9a-f]*[a-f][0-9a-f]*'
+plumb start Diff $0
+
+# a diff paged (git show, git log -p) is shown stacked in a +Diff in
+# its +Pager's place
+type is text/x-diff
+attr delete action
+attr add action=showdiff
+plumb to edit