From 47718a042544713af8ca704e584b422bef4b4c5f Mon Sep 17 00:00:00 2001 From: John Date: Mon, 3 Jun 2019 01:58:27 +0200 Subject: support perl-like file + line references --- dwim.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dwim.pl b/dwim.pl index de14ae5..6e9ce00 100755 --- a/dwim.pl +++ b/dwim.pl @@ -36,6 +36,12 @@ for ($phrase) { exec @LAUNCHER, @EDITOR, "-c", ":$2", "$p" } + if (/^(.+) line (\d+)\.?$/) { + handle "file \" line \" line (like perl)"; + my $p = path($1); + exec @LAUNCHER, @EDITOR, "-c", ":$2", "$p" + } + if (/^(.+):(.+)$/) { handle "file:query (like grep)"; my $p = path($1); -- cgit v1.2.3