Add option to disable asynchronous diffs.

Closes #318.
This commit is contained in:
Andy Stewart
2016-04-21 10:29:11 +01:00
parent cc77f32b5b
commit 530bf68fca
4 changed files with 22 additions and 1 deletions

View File

@@ -187,6 +187,7 @@ You can customise:
* Whether or not line highlighting is on initially (defaults to off)
* Whether or not vim-gitgutter runs in "realtime" (defaults to yes)
* Whether or not vim-gitgutter runs eagerly (defaults to yes)
* Whether or not vim-gitgutter runs asynchronously in NeoVim (defaults to yes)
Please note that vim-gitgutter won't override any colours or highlights you've set in your colorscheme.
@@ -299,6 +300,15 @@ Add `let g:gitgutter_signs = 0` to your `~/.vimrc`.
Add `let g:gitgutter_highlight_lines = 1` to your `~/.vimrc`.
#### To turn off asynchronous updates
By default diffs are run asynchronously in NeoVim. To run diffs synchronously instead:
```viml
let g:gitgutter_async = 0
```
### FAQ
> Why can't I unstage staged changes?

View File

@@ -127,7 +127,7 @@ function! gitgutter#diff#run_diff(realtime, preserve_full_diff)
call setbufvar(bufnr, 'gitgutter_tracked', 1)
endif
if has('nvim') && !a:preserve_full_diff
if g:gitgutter_async && has('nvim') && !a:preserve_full_diff
let cmd = gitgutter#utility#command_in_directory_of_file(cmd)
" Note that when `cmd` doesn't produce any output, i.e. the diff is empty,
" the `stdout` event is not fired on the job handler. Therefore we keep

View File

@@ -126,6 +126,7 @@ You can customise:
- Whether or not line highlighting is on initially (defaults to off)
- Whether or not vim-gitgutter runs in realtime (defaults to yes)
- Whether or not vim-gitgutter runs eagerly (defaults to yes)
- Whether or not vim-gitgutter runs asynchronously in NeoVim (defaults to yes)
Please note that vim-gitgutter won't override any colours or highlights you've
set in your colorscheme.
@@ -266,6 +267,15 @@ Add to your |vimrc|
let g:gitgutter_eager = 0
<
TO TURN OFF ASYNCHRONOUS UPDATES
By default diffs are run asynchronously in NeoVim. To run diffs synchronously
instead:
Add to your |vimrc|
>
let g:gitgutter_async = 0
<
===============================================================================
6. FAQ *GitGutterFAQ*

View File

@@ -49,6 +49,7 @@ call s:set('g:gitgutter_diff_args', '')
call s:set('g:gitgutter_diff_base', '')
call s:set('g:gitgutter_map_keys', 1)
call s:set('g:gitgutter_avoid_cmd_prompt_on_windows', 1)
call s:set('g:gitgutter_async', 1)
call gitgutter#highlight#define_sign_column_highlight()
call gitgutter#highlight#define_highlights()