From 1e3fc79949501141367d8257f24bdd93a001acb0 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 24 May 2017 19:43:31 -0500 Subject: 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. --- src/args.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/args.rs') 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()) } -- cgit v1.2.3