mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 12:03:48 -05:00
Avoid :redir inside execute()
This was happening when starting vim with `let g:gitgutter_log = 1` and generated E930.
This commit is contained in:
@@ -75,23 +75,21 @@ function! gitgutter#debug#log(message, ...) abort
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
execute 'redir >> '.s:log_file
|
|
||||||
if s:new_log_session
|
if s:new_log_session
|
||||||
let s:start = reltime()
|
let s:start = reltime()
|
||||||
silent echo "\n==== start log session ===="
|
call writefile(['==== start log session ===='], s:log_file, 'a')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let elapsed = reltimestr(reltime(s:start)).' '
|
let elapsed = reltimestr(reltime(s:start)).' '
|
||||||
silent echo ''
|
call writefile([''], s:log_file, 'a')
|
||||||
" callers excluding this function
|
" callers excluding this function
|
||||||
silent echo elapsed.expand('<sfile>')[:-22].':'
|
call writefile([elapsed.expand('<sfile>')[:-22].':'], s:log_file, 'a')
|
||||||
silent echo elapsed.s:format_for_log(a:message)
|
call writefile([elapsed.s:format_for_log(a:message)], s:log_file, 'a')
|
||||||
if a:0 && !empty(a:1)
|
if a:0 && !empty(a:1)
|
||||||
for msg in a:000
|
for msg in a:000
|
||||||
silent echo elapsed.s:format_for_log(msg)
|
call writefile([elapsed.s:format_for_log(msg)], s:log_file, 'a')
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
redir END
|
|
||||||
|
|
||||||
let s:new_log_session = 0
|
let s:new_log_session = 0
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user