From 2caf156c4708671690011819bcb5440aad3c5536 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Wed, 8 Jan 2014 09:47:43 +0100 Subject: [PATCH] Eliminate redundant argument. --- plugin/gitgutter.vim | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 3efbb43..2d7d953 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -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()