Eliminate redundant argument.

This commit is contained in:
Andy Stewart
2014-01-08 09:47:43 +01:00
parent 7919906105
commit 2caf156c47

View File

@@ -41,7 +41,7 @@ function! GitGutterAll()
for buffer_id in tabpagebuflist()
let file = expand('#' . buffer_id . ':p')
if !empty(file)
call GitGutter(file, 0, 0)
call GitGutter(file, 0)
endif
endfor
endfunction
@@ -51,12 +51,10 @@ command GitGutterAll call GitGutterAll()
"
" file: (string) the file to process.
" realtime: (boolean) when truthy, do a realtime diff; otherwise do a disk-based diff.
" fresh_changes: (boolean) when truthy, only process if there are buffer changes
" since the last gitgutter process; otherwise always process.
function! GitGutter(file, realtime, fresh_changes)
function! GitGutter(file, realtime)
call utility#set_file(a:file)
if utility#is_active()
if !a:fresh_changes || getbufvar(a:file, 'changedtick') != getbufvar(a:file, 'gitgutter_last_tick', -1)
if !a:realtime || getbufvar(a:file, 'changedtick') != getbufvar(a:file, 'gitgutter_last_tick', -1)
if a:realtime || utility#has_unsaved_changes(a:file)
let diff = diff#run_diff(1)
else
@@ -80,7 +78,7 @@ function! GitGutter(file, realtime, fresh_changes)
call hunk#reset()
endif
endfunction
command GitGutter call GitGutter(utility#current_file(), 0, 0)
command GitGutter call GitGutter(utility#current_file(), 0)
function! GitGutterDisable()
let g:gitgutter_enabled = 0
@@ -92,7 +90,7 @@ command GitGutterDisable call GitGutterDisable()
function! GitGutterEnable()
let g:gitgutter_enabled = 1
call GitGutter(utility#current_file(), 0, 0)
call GitGutter(utility#current_file(), 0)
endfunction
command GitGutterEnable call GitGutterEnable()
@@ -200,7 +198,7 @@ augroup gitgutter
autocmd!
if g:gitgutter_realtime
autocmd CursorHold,CursorHoldI * call GitGutter(utility#current_file(), 1, 1)
autocmd CursorHold,CursorHoldI * call GitGutter(utility#current_file(), 1)
endif
if g:gitgutter_eager
@@ -208,7 +206,7 @@ augroup gitgutter
\ if gettabvar(tabpagenr(), 'gitgutter_didtabenter')
\| call settabvar(tabpagenr(), 'gitgutter_didtabenter', 0)
\| else
\| call GitGutter(utility#current_file(), 0, 0)
\| call GitGutter(utility#current_file(), 0)
\| endif
autocmd TabEnter *
\ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
@@ -217,7 +215,7 @@ augroup gitgutter
autocmd FocusGained * call GitGutterAll()
endif
else
autocmd BufRead,BufWritePost,FileChangedShellPost * call GitGutter(utility#current_file(), 0, 0)
autocmd BufRead,BufWritePost,FileChangedShellPost * call GitGutter(utility#current_file(), 0)
endif
autocmd ColorScheme * call highlight#define_sign_column_highlight() | call highlight#define_highlights()