vim-airline/autoload/airline/extensions
d10n 39c61288e8 Fix git hunk status disappearance on CursorHold
When using vim-gitgutter and fugitive:

The hunks extension and the branch extension work as expected when the
file is first loaded; both parts are added to the statusline.

Once the cursor is moved and stopped for &updatetime ms:

1. The branch extension clears b:airline_head on CursorHold
2. Somehow (?) airline#statusline gets called on CursorHold
3. The hunks extension returns '' when b:airline_head is empty, causing
the hunks to be removed from the statusline.

It doesn't make sense to clear airline_head just because the cursor
moved, and the commit message adding the line doesn't say why:
13297cee03

Commit 174b7e1962 relies on airline_head
being set.

Debug detail:

Executing CursorHold Auto commands for "*"
autocommand unlet! b:airline_head
[...]
continuing in CursorHold Auto commands for "*"
calling function airline#statusline(1)
[...]
line 1:   return exists('*airline#extensions#branch#head') && empty(get(b:, 'airline_head', ''))
function airline#extensions#hunks#get_hunks[13]..<SNR>32_get_hunks[14]..<SNR>32_get_hunks_gitgutter[1]..<SNR>32_is_branch_empty returning #1
function airline#extensions#hunks#get_hunks[13]..<SNR>32_get_hunks[14]..<SNR>32_get_hunks_gitgutter returning ''
function airline#extensions#hunks#get_hunks[13]..<SNR>32_get_hunks returning ''
function airline#extensions#hunks#get_hunks returning ''

:au CursorHold
--- Auto-Commands ---
gitgutter  CursorHold
    *         call gitgutter#process_buffer(bufnr(''), 1)
CursorHold
    *         unlet! b:airline_head
airline_whitespace  CursorHold
    *         call <sid>ws_refresh()

------------------------

Sample vimrc:

set nocompatible

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | q | doautocmd WinEnter
endif

autocmd VimEnter *
  \  if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
  \|   PlugInstall --sync | q
  \| endif

call plug#begin('~/.vim/bundle/')
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
call plug#end()
set laststatus=2
set updatetime=250
let g:airline_theme = 'dark'
2017-07-01 11:57:08 -04:00
..
tabline tabline: only map keys if not done yet 2017-06-27 14:44:03 +02:00
wordcount/formatters Better reformat wordcount format in with separator 2017-02-24 18:28:48 +01:00
ale.vim Ale: Cache Warning and Errors 2017-06-27 13:52:48 +02:00
branch.vim Fix git hunk status disappearance on CursorHold 2017-07-01 11:57:08 -04:00
bufferline.vim bufferline: take 'acd' into account 2017-06-20 13:58:39 +02:00
capslock.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
commandt.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
csv.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
ctrlp.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
ctrlspace.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
default.vim wrong quoting of condition 2016-12-14 16:10:33 +01:00
denite.vim Improve denite extension performance 2017-06-12 22:00:25 +03:00
eclim.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
example.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
hunks.vim hunks: Make hunk extension slightly faster 2017-06-27 14:16:28 +02:00
neomake.vim Support for neomake 2016-09-27 21:21:35 +02:00
netrw.vim Do not error out, if a netrw variable is not defined 2017-06-19 15:56:17 +02:00
nrrwrgn.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
obsession.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
po.vim Check s:jobs dictionary before trying to remove jobid 2016-12-29 11:22:55 +01:00
promptline.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
quickfix.vim Use get() to access members of getwininfo() function 2017-01-21 22:02:40 +01:00
syntastic.vim Syntastic: remove unused variable 2017-06-22 09:47:01 +02:00
tabline.vim backout b2f301f73c 2017-06-28 21:10:57 +02:00
tagbar.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
tmuxline.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
undotree.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
unicode.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
unite.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
vimagit.vim Add vimagit extension 2017-01-19 14:02:53 +01:00
vimtex.vim Add vimtex support 2017-05-08 13:07:13 +03:00
virtualenv.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
whitespace.vim Fixes typo introduced in a10d321 2017-06-30 18:45:21 -04:00
windowswap.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
wordcount.vim Do not update wordcount on unknown buffers 2017-02-26 10:25:21 +01:00
xkblayout.vim Add vim-xkblayout extension to display keyboard layout 2017-01-18 12:34:14 +09:00
ycm.vim Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00