diff options
author | John <john@ankarstrom.se> | 2019-06-03 01:58:27 +0200 |
---|---|---|
committer | John <john@ankarstrom.se> | 2019-06-03 01:58:27 +0200 |
commit | 47718a042544713af8ca704e584b422bef4b4c5f (patch) | |
tree | 97641510191898ce05e547443840c888c37f1a08 | |
parent | 22d1803698b05203d2c4e5c0884a0572f5768c86 (diff) | |
download | dwim-47718a042544713af8ca704e584b422bef4b4c5f.tar.gz |
support perl-like file + line references
-rwxr-xr-x | dwim.pl | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |