From ad3c44c97fa496527c7d4864fa29518b6dde9354 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 24 May 2017 19:43:31 -0500 Subject: [PATCH] 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(+) diff --git a/src/args.rs b/src/args.rs index 9e941a7ba..cc3f739fe 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()) }