aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn <john@ankarstrom.se>2019-06-03 01:58:27 +0200
committerJohn <john@ankarstrom.se>2019-06-03 01:58:27 +0200
commit47718a042544713af8ca704e584b422bef4b4c5f (patch)
tree97641510191898ce05e547443840c888c37f1a08
parent22d1803698b05203d2c4e5c0884a0572f5768c86 (diff)
downloaddwim-47718a042544713af8ca704e584b422bef4b4c5f.tar.gz
support perl-like file + line references
-rwxr-xr-xdwim.pl6
1 files changed, 6 insertions, 0 deletions
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);