summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Nielsen <eric@amalgamar.com.br>2017-05-24 19:43:31 -0500
committerAndrew Gallant <jamslam@gmail.com>2017-05-24 23:12:16 -0400
commit1e3fc79949501141367d8257f24bdd93a001acb0 (patch)
treeb1504df56019f6a88547225986c28523b545df8e /src
parentd1bbc6956bd21b4fa98e7e5c255867fa2bd8fa32 (diff)
Should show filename for one file with vimgrep
With vim configured with: set grepprg=rg\ --vimgrep set grepformat^=%f:%l:%c:%m and running the command `:grep 'vimgrep' doc/rg.1`, the output should be: doc/rg.1:446:8:.B \-\-vimgrep but the actual output was: 446:8:.B \-\-vimgrep Same issue would happen if results only match one file. Ag behaves as expected.
Diffstat (limited to 'src')
-rw-r--r--src/args.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index 9e941a7b..cc3f739f 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -532,6 +532,7 @@ impl<'a> ArgMatches<'a> {
false
} else {
self.is_present("with-filename")
+ || self.is_present("vimgrep")
|| paths.len() > 1
|| paths.get(0).map_or(false, |p| p.is_dir())
}