Skip to content

Commit 8ff0923

Browse files
committed
Minor updates to doc and code
1 parent d49f185 commit 8ff0923

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

autoload/greplace.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ endfunction
223223
" greplace#show_matches
224224
" Display the search results in the replace buffer
225225
function! greplace#show_matches(search_pat)
226+
let s:save_qf_list = {}
227+
226228
let qf = getqflist()
227229
if empty(qf)
228230
call s:warn_msg('Error: Quickfix list is empty')
@@ -334,10 +336,10 @@ function! greplace#search(type, ...)
334336
if pattern == ''
335337
return
336338
endif
337-
endif
338339

339-
" Escape the special characters in the supplied pattern
340-
let pattern = shellescape(pattern)
340+
" Escape the special characters in the supplied pattern
341+
let pattern = shellescape(pattern)
342+
endif
341343

342344
if a:type == 'grep'
343345
if filenames == ''

doc/greplace.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ across several files in a single pass.
2525

2626
This plugin will run only on Vim 7.0 and above.
2727

28+
The github repository for this plugin is at
29+
https://github.com/yegappan/greplace
30+
2831
==============================================================================
2932
2. Installation *greplace-installation*
3033

@@ -97,7 +100,7 @@ Vim internal grep, set the "grepprg" option to "internal".
97100

98101
The syntax of the ":Gsearch" command is:
99102
>
100-
:Gsearch [<grep-option(s)>] [[<pattern>] [<filename(s)>]]
103+
:Gsearch [<grep-option(s)>] [[<pattern>] [<filename(s)>]]
101104
<
102105
The arguments to the ":Gsearch" command are optional.
103106

@@ -107,8 +110,10 @@ MS-Windows). For example, to ignore case, you can use "-i" for the Unix
107110
grep program.
108111

109112
The next argument specifies the pattern. You cannot use space characters in
110-
the pattern. To specify space characters in the pattern, don't specify the
111-
pattern in the command-line. See below for more information.
113+
the pattern. To specify space or other special characters in the pattern,
114+
don't specify the pattern in the command-line. You will then be prompted to
115+
enter the pattern where you can enter the special characters. See below for
116+
more information.
112117

113118
The last set of arguments specify the filenames. You can use wild cards (like
114119
'*') in the filenames. You can also complete directory and file names by
@@ -117,14 +122,14 @@ pressing <Tab>.
117122
If the pattern or the filenames is not supplied as argument to the ":Gsearch"
118123
command, then you will be prompted to enter the pattern and the filenames. The
119124
default value for the search pattern is the keyword under the cursor. In the
120-
prompt for entering the pattern, you can enter a pattern with space
121-
characters. In the prompt for entering the filenames, you can press <Tab> to
122-
complete the directory and file names.
125+
prompt for entering the pattern, you can enter a pattern with space and other
126+
special characters. In the prompt for entering the filenames, you can press
127+
<Tab> to complete the directory and file names.
123128

124129
To search for a pattern in the files in the Vim buffer list, use the
125130
":Gbuffersearch" command. The syntax of this command is:
126131
>
127-
:Gbuffersearch [<grep-option(s)>]
132+
:Gbuffersearch [<grep-option(s)>]
128133
<
129134
This command is similar to the ":Gsearch" command. This command searches for
130135
the specified pattern in all the files in the buffer list. You cannot specify
@@ -133,7 +138,7 @@ filenames to this command.
133138
To search for a pattern in the files in the Vim argument list, use the
134139
":Gargsearch" command. The syntax of this command is:
135140
>
136-
:Gargsearch [<grep-option(s)>]
141+
:Gargsearch [<grep-option(s)>]
137142
<
138143
This command is similar to the ":Gsearch" command. This command will search
139144
for the specified pattern in all the files in the argument list. You cannot

0 commit comments

Comments
 (0)