From dce56de1fafb4444cc2636ae79c5086ac787a8cc Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 21 Feb 2011 18:49:02 +0100 Subject: [PATCH] Fix path handling of buffers in RunGrepSpecial. 1. use fnamemodify to get the absolute pathname of the buffer 2. use filereadable to test for its existence 3. escape it using fnameescape. --- plugin/grep.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/grep.vim b/plugin/grep.vim index b9e8f32..31d3c27 100644 --- a/plugin/grep.vim +++ b/plugin/grep.vim @@ -618,7 +618,10 @@ function! s:RunGrepSpecial(cmd_name, which, action, ...) while i <= last_bufno if bufexists(i) && buflisted(i) - let filenames = filenames . " " . bufname(i) + let full_path = fnamemodify(bufname(i), ':p') + if filereadable(full_path) + let filenames = filenames . " " . fnameescape(full_path) + endif endif let i = i + 1 endwhile