From 0590c64260739c0736967b69654f89bee98ed5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 15 Jun 2021 08:09:44 +0200 Subject: Handle diff -u headers --- dwim | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- cgit v1.2.3