mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-09 03:53:47 -05:00
Eliminate redundant argument.
This commit is contained in:
@@ -41,7 +41,7 @@ function! GitGutterAll()
|
|||||||
for buffer_id in tabpagebuflist()
|
for buffer_id in tabpagebuflist()
|
||||||
let file = expand('#' . buffer_id . ':p')
|
let file = expand('#' . buffer_id . ':p')
|
||||||
if !empty(file)
|
if !empty(file)
|
||||||
call GitGutter(file, 0, 0)
|
call GitGutter(file, 0)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
@@ -51,12 +51,10 @@ command GitGutterAll call GitGutterAll()
|
|||||||
"
|
"
|
||||||
" file: (string) the file to process.
|
" file: (string) the file to process.
|
||||||
" realtime: (boolean) when truthy, do a realtime diff; otherwise do a disk-based diff.
|
" 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
|
function! GitGutter(file, realtime)
|
||||||
" since the last gitgutter process; otherwise always process.
|
|
||||||
function! GitGutter(file, realtime, fresh_changes)
|
|
||||||
call utility#set_file(a:file)
|
call utility#set_file(a:file)
|
||||||
if utility#is_active()
|
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)
|
if a:realtime || utility#has_unsaved_changes(a:file)
|
||||||
let diff = diff#run_diff(1)
|
let diff = diff#run_diff(1)
|
||||||
else
|
else
|
||||||
@@ -80,7 +78,7 @@ function! GitGutter(file, realtime, fresh_changes)
|
|||||||
call hunk#reset()
|
call hunk#reset()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
command GitGutter call GitGutter(utility#current_file(), 0, 0)
|
command GitGutter call GitGutter(utility#current_file(), 0)
|
||||||
|
|
||||||
function! GitGutterDisable()
|
function! GitGutterDisable()
|
||||||
let g:gitgutter_enabled = 0
|
let g:gitgutter_enabled = 0
|
||||||
@@ -92,7 +90,7 @@ command GitGutterDisable call GitGutterDisable()
|
|||||||
|
|
||||||
function! GitGutterEnable()
|
function! GitGutterEnable()
|
||||||
let g:gitgutter_enabled = 1
|
let g:gitgutter_enabled = 1
|
||||||
call GitGutter(utility#current_file(), 0, 0)
|
call GitGutter(utility#current_file(), 0)
|
||||||
endfunction
|
endfunction
|
||||||
command GitGutterEnable call GitGutterEnable()
|
command GitGutterEnable call GitGutterEnable()
|
||||||
|
|
||||||
@@ -200,7 +198,7 @@ augroup gitgutter
|
|||||||
autocmd!
|
autocmd!
|
||||||
|
|
||||||
if g:gitgutter_realtime
|
if g:gitgutter_realtime
|
||||||
autocmd CursorHold,CursorHoldI * call GitGutter(utility#current_file(), 1, 1)
|
autocmd CursorHold,CursorHoldI * call GitGutter(utility#current_file(), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:gitgutter_eager
|
if g:gitgutter_eager
|
||||||
@@ -208,7 +206,7 @@ augroup gitgutter
|
|||||||
\ if gettabvar(tabpagenr(), 'gitgutter_didtabenter')
|
\ if gettabvar(tabpagenr(), 'gitgutter_didtabenter')
|
||||||
\| call settabvar(tabpagenr(), 'gitgutter_didtabenter', 0)
|
\| call settabvar(tabpagenr(), 'gitgutter_didtabenter', 0)
|
||||||
\| else
|
\| else
|
||||||
\| call GitGutter(utility#current_file(), 0, 0)
|
\| call GitGutter(utility#current_file(), 0)
|
||||||
\| endif
|
\| endif
|
||||||
autocmd TabEnter *
|
autocmd TabEnter *
|
||||||
\ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
\ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
||||||
@@ -217,7 +215,7 @@ augroup gitgutter
|
|||||||
autocmd FocusGained * call GitGutterAll()
|
autocmd FocusGained * call GitGutterAll()
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
autocmd BufRead,BufWritePost,FileChangedShellPost * call GitGutter(utility#current_file(), 0, 0)
|
autocmd BufRead,BufWritePost,FileChangedShellPost * call GitGutter(utility#current_file(), 0)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
autocmd ColorScheme * call highlight#define_sign_column_highlight() | call highlight#define_highlights()
|
autocmd ColorScheme * call highlight#define_sign_column_highlight() | call highlight#define_highlights()
|
||||||
|
|||||||
Reference in New Issue
Block a user