aboutsummaryrefslogtreecommitdiff
path: root/.vim/autoload/airline/extensions/undotree.vim
blob: 9e43dfb4ec02dcd3160c585d24303a20f5aa99d9 (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
28
" MIT License. Copyright (c) 2013-2018 Bailey Ling et al.
" vim: et ts=2 sts=2 sw=2

scriptencoding utf-8

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