Extract utility functions.

This commit is contained in:
Andy Stewart
2014-01-08 09:55:54 +01:00
parent 6369f5033b
commit 03ca0f8d93
2 changed files with 10 additions and 2 deletions

View File

@@ -28,6 +28,14 @@ function! utility#has_unsaved_changes(file)
return getbufvar(a:file, "&mod")
endfunction
function! utility#has_fresh_changes(file)
return getbufvar(a:file, 'changedtick') != getbufvar(a:file, 'gitgutter_last_tick', -1)
endfunction
function! utility#save_last_seen_change(file)
call setbufvar(a:file, 'gitgutter_last_tick', getbufvar(a:file, 'changedtick'))
endfunction
" https://github.com/tpope/vim-dispatch/blob/9cdd05a87f8a47120335be03dfcd8358544221cd/autoload/dispatch/windows.vim#L8-L17
function! utility#escape(str)
if &shellxquote ==# '"'