From 8ff09232c5b5015c3c22aa821c50f9415d010c39 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 3 Mar 2018 12:49:53 -0800 Subject: [PATCH] Minor updates to doc and code --- autoload/greplace.vim | 8 +++++--- doc/greplace.txt | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/autoload/greplace.vim b/autoload/greplace.vim index 13f71fb..b6f9f41 100644 --- a/autoload/greplace.vim +++ b/autoload/greplace.vim @@ -223,6 +223,8 @@ endfunction " greplace#show_matches " Display the search results in the replace buffer function! greplace#show_matches(search_pat) + let s:save_qf_list = {} + let qf = getqflist() if empty(qf) call s:warn_msg('Error: Quickfix list is empty') @@ -334,10 +336,10 @@ function! greplace#search(type, ...) if pattern == '' return endif - endif - " Escape the special characters in the supplied pattern - let pattern = shellescape(pattern) + " Escape the special characters in the supplied pattern + let pattern = shellescape(pattern) + endif if a:type == 'grep' if filenames == '' diff --git a/doc/greplace.txt b/doc/greplace.txt index c187c4d..91a9dff 100644 --- a/doc/greplace.txt +++ b/doc/greplace.txt @@ -25,6 +25,9 @@ across several files in a single pass. This plugin will run only on Vim 7.0 and above. +The github repository for this plugin is at +https://github.com/yegappan/greplace + ============================================================================== 2. Installation *greplace-installation* @@ -97,7 +100,7 @@ Vim internal grep, set the "grepprg" option to "internal". The syntax of the ":Gsearch" command is: > - :Gsearch [] [[] []] + :Gsearch [] [[] []] < The arguments to the ":Gsearch" command are optional. @@ -107,8 +110,10 @@ MS-Windows). For example, to ignore case, you can use "-i" for the Unix grep program. The next argument specifies the pattern. You cannot use space characters in -the pattern. To specify space characters in the pattern, don't specify the -pattern in the command-line. See below for more information. +the pattern. To specify space or other special characters in the pattern, +don't specify the pattern in the command-line. You will then be prompted to +enter the pattern where you can enter the special characters. See below for +more information. The last set of arguments specify the filenames. You can use wild cards (like '*') in the filenames. You can also complete directory and file names by @@ -117,14 +122,14 @@ pressing . If the pattern or the filenames is not supplied as argument to the ":Gsearch" command, then you will be prompted to enter the pattern and the filenames. The default value for the search pattern is the keyword under the cursor. In the -prompt for entering the pattern, you can enter a pattern with space -characters. In the prompt for entering the filenames, you can press to -complete the directory and file names. +prompt for entering the pattern, you can enter a pattern with space and other +special characters. In the prompt for entering the filenames, you can press + to complete the directory and file names. To search for a pattern in the files in the Vim buffer list, use the ":Gbuffersearch" command. The syntax of this command is: > - :Gbuffersearch [] + :Gbuffersearch [] < This command is similar to the ":Gsearch" command. This command searches for the specified pattern in all the files in the buffer list. You cannot specify @@ -133,7 +138,7 @@ filenames to this command. To search for a pattern in the files in the Vim argument list, use the ":Gargsearch" command. The syntax of this command is: > - :Gargsearch [] + :Gargsearch [] < This command is similar to the ":Gsearch" command. This command will search for the specified pattern in all the files in the argument list. You cannot