aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-15 08:09:44 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-15 08:09:44 +0200
commit0590c64260739c0736967b69654f89bee98ed5df (patch)
treeef79c5108b1829d8b0a83d00a4793e79804194cb
parentfc37fb24c08602e112bcce8322d2a63cad7184fe (diff)
downloaddwim-0590c64260739c0736967b69654f89bee98ed5df.tar.gz
Handle diff -u headers
-rwxr-xr-xdwim7
1 files changed, 7 insertions, 0 deletions
diff --git a/dwim b/dwim
index 49fd9f5..91ce5b8 100755
--- a/dwim
+++ b/dwim
@@ -98,6 +98,13 @@ for ($phrase) {
fail 'header file not found';
}
+ if (/(?:\+\+\+|---) (\S+) .*?$@@ -(\d+)/ms) {
+ handle 'diff header';
+ my ($p, $l) = ($1, $2);
+ $p = path($p)."/$p" if not $p =~ m{^/};
+ run @EDITOR, "+$l", $p;
+ }
+
if (/^(\S+)$/) {
handle 'maildir / directory / file';
my $p = path $1;