aboutsummaryrefslogtreecommitdiff
path: root/vim/.vim/bundle/vim-airline/autoload/airline/extensions/undotree.vim
blob: f577ffd8d6d9b2e82bd119a5a811f96e4506dbe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
" vim: et ts=2 sts=2 sw=2

if !exists(':UndotreeToggle')
  finish
endif

function! airline#extensions#undotree#apply(...)
  if exists('t:undotree')
    if &ft == 'undotree'
      if exists('*t:undotree.GetStatusLine')
        call airline#extensions#apply_left_override('undo', '%{t:undotree.GetStatusLine()}')
      else
        call airline#extensions#apply_left_override('undotree', '%f')
      endif
    endif

    if &ft == 'diff' && exists('*t:diffpanel.GetStatusLine')
      call airline#extensions#apply_left_override('diff', '%{t:diffpanel.GetStatusLine()}')
    endif
  endif
endfunction

function! airline#extensions#undotree#init(ext)
  call a:ext.add_statusline_func('airline#extensions#undotree#apply')
endfunction