mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Add g:gitgutter_terminal_reports_focus to enable FocusGained workaround.
See #490.
This commit is contained in:
@@ -24,7 +24,7 @@ Features:
|
|||||||
Constraints:
|
Constraints:
|
||||||
|
|
||||||
* Supports git only. If you work with other version control systems, I recommend [vim-signify](https://github.com/mhinz/vim-signify).
|
* Supports git only. If you work with other version control systems, I recommend [vim-signify](https://github.com/mhinz/vim-signify).
|
||||||
* Relies on the `FocusGained` event. If your terminal doesn't report focus events, I suggest using something like [Terminus][].
|
* Relies on the `FocusGained` event. If your terminal doesn't report focus events, either use something like [Terminus][] or set `let g:gitgutter_terminal_reports_focus=0`.
|
||||||
|
|
||||||
|
|
||||||
### Screenshot
|
### Screenshot
|
||||||
@@ -506,7 +506,7 @@ Here are some things you can check:
|
|||||||
|
|
||||||
#### When signs don't update after focusing Vim
|
#### When signs don't update after focusing Vim
|
||||||
|
|
||||||
* Your terminal probably isn't reporting focus events. Try installing [Terminus][].
|
* Your terminal probably isn't reporting focus events. Either try installing [Terminus][] or set `let g:gitgutter_terminal_reports_focus=0`.
|
||||||
|
|
||||||
|
|
||||||
### Shameless Plug
|
### Shameless Plug
|
||||||
|
|||||||
@@ -252,6 +252,10 @@ Signs:~
|
|||||||
|g:gitgutter_sign_column_always|
|
|g:gitgutter_sign_column_always|
|
||||||
|g:gitgutter_override_sign_column_highlight|
|
|g:gitgutter_override_sign_column_highlight|
|
||||||
|
|
||||||
|
Terminal:~
|
||||||
|
|
||||||
|
|g:gitgutter_terminal_reports_focus|
|
||||||
|
|
||||||
General:~
|
General:~
|
||||||
|
|
||||||
|g:gitgutter_enabled|
|
|g:gitgutter_enabled|
|
||||||
@@ -365,6 +369,22 @@ it in your |vimrc|:
|
|||||||
User-defined (terminal Vim) highlight SignColumn ctermbg={whatever}
|
User-defined (terminal Vim) highlight SignColumn ctermbg={whatever}
|
||||||
User-defined (graphical Vim) highlight SignColumn guibg={whatever}
|
User-defined (graphical Vim) highlight SignColumn guibg={whatever}
|
||||||
|
|
||||||
|
|
||||||
|
*g:gitgutter_terminal_reports_focus*
|
||||||
|
Default: 1
|
||||||
|
|
||||||
|
Normally the plugin uses |FocusGained| to force-update all buffers when Vim
|
||||||
|
receives focus. However some terminals do not report focus events and so the
|
||||||
|
|FocusGained| autocommand never fires.
|
||||||
|
|
||||||
|
If this applies to you, either install something like Terminus
|
||||||
|
(https://github.com/wincent/terminus) to make |FocusGained| work or set this
|
||||||
|
option to 0.
|
||||||
|
|
||||||
|
When this option is 0, the plugin force-updates the buffer on |BufEnter|
|
||||||
|
(instead of only updating if the buffer's contents has changed since the last
|
||||||
|
update).
|
||||||
|
|
||||||
*g:gitgutter_enabled*
|
*g:gitgutter_enabled*
|
||||||
Default: 1
|
Default: 1
|
||||||
|
|
||||||
@@ -491,6 +511,9 @@ Try reducing 'updatetime':
|
|||||||
|
|
||||||
When signs don't update after focusing Vim:~
|
When signs don't update after focusing Vim:~
|
||||||
|
|
||||||
Your terminal probably isn't reporting focus events. Try installing Terminus
|
Your terminal probably isn't reporting focus events. Either try installing
|
||||||
(https://github.com/wincent/terminus).
|
Terminus (https://github.com/wincent/terminus) or set:
|
||||||
|
>
|
||||||
|
let g:gitgutter_terminal_reports_focus = 0
|
||||||
|
<
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ call s:set('g:gitgutter_sign_modified_removed', '~_')
|
|||||||
call s:set('g:gitgutter_diff_args', '')
|
call s:set('g:gitgutter_diff_args', '')
|
||||||
call s:set('g:gitgutter_diff_base', '')
|
call s:set('g:gitgutter_diff_base', '')
|
||||||
call s:set('g:gitgutter_map_keys', 1)
|
call s:set('g:gitgutter_map_keys', 1)
|
||||||
|
call s:set('g:gitgutter_terminal_reports_focus', 1)
|
||||||
call s:set('g:gitgutter_async', 1)
|
call s:set('g:gitgutter_async', 1)
|
||||||
call s:set('g:gitgutter_log', 0)
|
call s:set('g:gitgutter_log', 0)
|
||||||
|
|
||||||
@@ -209,10 +210,10 @@ augroup gitgutter
|
|||||||
autocmd BufEnter *
|
autocmd BufEnter *
|
||||||
\ if exists('t:gitgutter_didtabenter') && t:gitgutter_didtabenter |
|
\ if exists('t:gitgutter_didtabenter') && t:gitgutter_didtabenter |
|
||||||
\ let t:gitgutter_didtabenter = 0 |
|
\ let t:gitgutter_didtabenter = 0 |
|
||||||
\ call gitgutter#all(0) |
|
\ call gitgutter#all(!g:gitgutter_terminal_reports_focus) |
|
||||||
\ else |
|
\ else |
|
||||||
\ call gitgutter#init_buffer(bufnr('')) |
|
\ call gitgutter#init_buffer(bufnr('')) |
|
||||||
\ call gitgutter#process_buffer(bufnr(''), 0) |
|
\ call gitgutter#process_buffer(bufnr(''), !g:gitgutter_terminal_reports_focus) |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
autocmd CursorHold,CursorHoldI * call gitgutter#process_buffer(bufnr(''), 0)
|
autocmd CursorHold,CursorHoldI * call gitgutter#process_buffer(bufnr(''), 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user