@@ -186,12 +186,7 @@ function! s:_format_throwpoint(throwpoint) abort
186
186
endfunction
187
187
188
188
function ! s: _get_file_by_func_name (name) abort
189
- try
190
- redir = > body
191
- silent execute ' verbose function' a: name
192
- finally
193
- redir END
194
- endtry
189
+ let body = execute (printf (' verbose function %s' , a: name ))
195
190
let lines = split (body, " \n " )
196
191
let signature = matchstr (lines [0 ], ' ^\s*\zs.*' )
197
192
let file = matchstr (lines [1 ], ' ^\t\%(Last set from\|.\{-}:\)\s*\zs.*$' )
@@ -265,7 +260,7 @@ function! s:_sid(path, filter_pattern) abort
265
260
if has_key (s: cache_sid , unified_path)
266
261
return s: cache_sid [unified_path]
267
262
endif
268
- for line in filter (split (s: _execute (' :scriptnames' ), " \n " ), ' v:val =~# a:filter_pattern' )
263
+ for line in filter (split (execute (' :scriptnames' ), " \n " ), ' v:val =~# a:filter_pattern' )
269
264
let [_, sid , path ; __] = matchlist (line , ' ^\s*\(\d\+\):\s\+\(.\+\)\s*$' )
270
265
if s: _unify_path (path ) is # unified_path
271
266
let s: cache_sid [unified_path] = sid
@@ -275,21 +270,6 @@ function! s:_sid(path, filter_pattern) abort
275
270
return 0
276
271
endfunction
277
272
278
- " We want to use an execute() builtin function instead of s:_execute(),
279
- " however there is a bug in execute().
280
- " execute() returns empty string when it is called in
281
- " completion function of user defined ex command.
282
- " https://github.com/vim-jp/issues/issues/1129
283
- function ! s: _execute (cmd) abort
284
- let [save_verbose, save_verbosefile] = [&verbose , &verbosefile ]
285
- set verbose = 0 verbosefile =
286
- redir = > res
287
- silent ! execute a: cmd
288
- redir END
289
- let [&verbose , &verbosefile ] = [save_verbose, save_verbosefile]
290
- return res
291
- endfunction
292
-
293
273
if filereadable (expand (' <sfile>:r' ) . ' .VIM' ) " is case-insensitive or not
294
274
let s: _unify_path_cache = {}
295
275
" resolve() is slow, so we cache results.
@@ -314,7 +294,7 @@ endif
314
294
" copied and modified from Vim.ScriptLocal
315
295
let s: SNR = join (map (range (len (" \<SNR> " )), ' "[\\x" . printf("%0x", char2nr("\<SNR>"[v:val])) . "]"' ), ' ' )
316
296
function ! s: sid2sfuncs (sid ) abort
317
- let fs = split (s: _execute (printf (' :function /^%s%s_' , s: SNR , a: sid )), " \n " )
297
+ let fs = split (execute (printf (' :function /^%s%s_' , s: SNR , a: sid )), " \n " )
318
298
let r = {}
319
299
let pattern = printf (' \m^function\s<SNR>%d_\zs\w\{-}\ze(' , a: sid )
320
300
for fname in map (fs , ' matchstr(v:val, pattern)' )
0 commit comments