File tree Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Expand file tree Collapse file tree 4 files changed +27
-13
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,13 @@ let s:current_query = ''
17
17
"
18
18
" Basic process: query, parse, render and display.
19
19
"
20
- func ! s: ExecSearch (args ) abort
20
+ func ! s: ExecSearch (args , override = v: false ) abort
21
21
" reset all states
22
- call s: Reset ()
22
+
23
+ call s: Reset (a: override )
23
24
24
25
try
25
- call ctrlsf#opt#ParseOptions (a: args )
26
+ call ctrlsf#opt#ParseOptions (a: args, a: override )
26
27
catch /ParseOptionsException/
27
28
return -1
28
29
endtry
43
44
"
44
45
" Reset all states of many modules
45
46
"
46
- func ! s: Reset () abort
47
+ func ! s: Reset (override ) abort
47
48
call ctrlsf#db#Reset ()
48
- call ctrlsf#opt#Reset ()
49
+ if ! a: override
50
+ call ctrlsf#opt#Reset ()
51
+ endif
49
52
call ctrlsf#win#Reset ()
50
53
call ctrlsf#view#Reset ()
51
54
call ctrlsf#async#Reset ()
@@ -164,11 +167,11 @@ endf
164
167
165
168
" Update()
166
169
"
167
- func ! ctrlsf#Update () abort
170
+ func ! ctrlsf#Update (args ) abort
168
171
if empty (s: current_query )
169
172
return -1
170
173
endif
171
- call s: ExecSearch (s: current_query )
174
+ call s: ExecSearch (a: args , v: true )
172
175
endf
173
176
174
177
" Open()
Original file line number Diff line number Diff line change @@ -313,10 +313,20 @@ func! s:ParseOptions(options_str) abort
313
313
return options
314
314
endf
315
315
316
+ function ! ctrlsf#opt#Options ()
317
+ return s: options
318
+ endfunction
319
+
316
320
" ParseOptions()
317
321
"
318
- func ! ctrlsf#opt#ParseOptions (options_str) abort
319
- let s: options = s: ParseOptions (a: options_str )
322
+ func ! ctrlsf#opt#ParseOptions (options_str, override = v: false ) abort
323
+ let opts = s: ParseOptions (a: options_str )
324
+
325
+ if a: override
326
+ call extend (s: options , opts, ' force' )
327
+ else
328
+ let s: options = opts
329
+ endif
320
330
321
331
" derivative options
322
332
Original file line number Diff line number Diff line change @@ -155,10 +155,11 @@ mode:
155
155
If CtrlSF window is closed (by <q> or | :CtrlSFClose | ), reopen it. If the
156
156
window is already on display, then focus it.
157
157
158
- :CtrlSFUpdate *:CtrlSFUpdate*
158
+ :CtrlSFUpdate [arguments] {pattern} [path] ... *:CtrlSFUpdate*
159
159
160
- Update CtrlSF result by invoking a new search with same arguments and pattern
161
- of last one.
160
+ If no arguments, update CtrlSF result by invoking a new search with same
161
+ arguments and pattern of last one. Otherwise, will override last search
162
+ arguments and do the search.
162
163
163
164
:CtrlSFClose *:CtrlSFClose*
164
165
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ endif
321
321
com ! -n =* -comp =customlist ,ctrlsf#comp #Completion CtrlSF call ctrlsf#Search (<q-args> )
322
322
com ! -n =* -comp =customlist ,ctrlsf#comp #Completion CtrlSFQuickfix call ctrlsf#Quickfix (<q-args> )
323
323
com ! -n =0 CtrlSFOpen call ctrlsf#Open ()
324
- com ! -n =0 CtrlSFUpdate call ctrlsf#Update ()
324
+ com ! -n =* - comp = customlist ,ctrlsf# comp #Completion CtrlSFUpdate call ctrlsf#Update (<q-args> )
325
325
com ! -n =0 CtrlSFClose call ctrlsf#Quit ()
326
326
com ! -n =0 CtrlSFClearHL call ctrlsf#ClearSelectedLine ()
327
327
com ! -n =0 CtrlSFToggle call ctrlsf#Toggle ()
You can’t perform that action at this time.
0 commit comments