mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-10 04:23:46 -05:00
Make the 'exceeded max signs' warning less intrusive.
- Only show it once per buffer. - Redraw before echo to avoid the hit-enter prompt. See #259.
This commit is contained in:
@@ -10,6 +10,16 @@ function! gitgutter#utility#warn(message)
|
||||
let v:warningmsg = a:message
|
||||
endfunction
|
||||
|
||||
function! gitgutter#utility#warn_once(message, key)
|
||||
if empty(getbufvar(s:bufnr, a:key))
|
||||
call setbufvar(s:bufnr, a:key, '1')
|
||||
echohl WarningMsg
|
||||
redraw | echo 'vim-gitgutter: ' . a:message
|
||||
echohl None
|
||||
let v:warningmsg = a:message
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Returns truthy when the buffer's file should be processed; and falsey when it shouldn't.
|
||||
" This function does not and should not make any system calls.
|
||||
function! gitgutter#utility#is_active()
|
||||
|
||||
Reference in New Issue
Block a user