Big refactor.

- Hunk stage/undo/preview no longer saves the buffer.
- Hunk undo no longer makes locations go out of sync.
- Grep can be opted out of (grep output with ansi escapes is number one cause
  of issues).
- Replaced g:gitgutter_grep_command with g:gitgutter_grep.
- Always runs git-diff the same way instead of in two possible ways.
- Separated detection of git tracking from diffing.
- Simplified path handling.
- Removed support for xolox shell: Windows taskbar does not flash with async
  jobs.
- Removed g:gitgutter_{eager,realtime}.
- Simplified implementation generally.
This commit is contained in:
Andy Stewart
2018-02-08 10:12:38 +00:00
parent 932ffaca09
commit 5bfe5b9209
12 changed files with 750 additions and 875 deletions

View File

@@ -12,67 +12,67 @@ function! gitgutter#debug#debug()
setlocal bufhidden=delete
setlocal noswapfile
call gitgutter#debug#vim_version()
call gitgutter#debug#separator()
call s:vim_version()
call s:separator()
call gitgutter#debug#git_version()
call gitgutter#debug#separator()
call s:git_version()
call s:separator()
call gitgutter#debug#grep_version()
call gitgutter#debug#separator()
call s:grep_version()
call s:separator()
call gitgutter#debug#option('updatetime')
call gitgutter#debug#option('shell')
call gitgutter#debug#option('shellcmdflag')
call gitgutter#debug#option('shellpipe')
call gitgutter#debug#option('shellquote')
call gitgutter#debug#option('shellredir')
call gitgutter#debug#option('shellslash')
call gitgutter#debug#option('shelltemp')
call gitgutter#debug#option('shelltype')
call gitgutter#debug#option('shellxescape')
call gitgutter#debug#option('shellxquote')
call s:option('updatetime')
call s:option('shell')
call s:option('shellcmdflag')
call s:option('shellpipe')
call s:option('shellquote')
call s:option('shellredir')
call s:option('shellslash')
call s:option('shelltemp')
call s:option('shelltype')
call s:option('shellxescape')
call s:option('shellxquote')
endfunction
function! gitgutter#debug#separator()
call gitgutter#debug#output('')
function! s:separator()
call s:output('')
endfunction
function! gitgutter#debug#vim_version()
function! s:vim_version()
redir => version_info
silent execute 'version'
redir END
call gitgutter#debug#output(split(version_info, '\n')[0:2])
call s:output(split(version_info, '\n')[0:2])
endfunction
function! gitgutter#debug#git_version()
function! s:git_version()
let v = system(g:gitgutter_git_executable.' --version')
call gitgutter#debug#output( substitute(v, '\n$', '', '') )
call s:output( substitute(v, '\n$', '', '') )
endfunction
function! gitgutter#debug#grep_version()
function! s:grep_version()
let v = system('grep --version')
call gitgutter#debug#output( substitute(v, '\n$', '', '') )
call s:output( substitute(v, '\n$', '', '') )
let v = system('grep --help')
call gitgutter#debug#output( substitute(v, '\%x00', '', 'g') )
call s:output( substitute(v, '\%x00', '', 'g') )
endfunction
function! gitgutter#debug#option(name)
function! s:option(name)
if exists('+' . a:name)
let v = eval('&' . a:name)
call gitgutter#debug#output(a:name . '=' . v)
call s:output(a:name . '=' . v)
" redir => output
" silent execute "verbose set " . a:name . "?"
" redir END
" call gitgutter#debug#output(a:name . '=' . output)
" call s:output(a:name . '=' . output)
else
call gitgutter#debug#output(a:name . ' [n/a]')
call s:output(a:name . ' [n/a]')
end
endfunction
function! gitgutter#debug#output(text)
function! s:output(text)
call append(line('$'), a:text)
endfunction