undotree.vim 911 B

1234567891011121314151617181920212223242526272829
  1. " MIT License. Copyright (c) 2013-2021 Bailey Ling et al.
  2. " Plugin: https://github.com/mbbill/undotree
  3. " vim: et ts=2 sts=2 sw=2
  4. scriptencoding utf-8
  5. if !exists(':UndotreeToggle')
  6. finish
  7. endif
  8. function! airline#extensions#undotree#apply(...)
  9. if exists('t:undotree')
  10. if &ft == 'undotree'
  11. if exists('*t:undotree.GetStatusLine')
  12. call airline#extensions#apply_left_override('undo', '%{exists("t:undotree") ? t:undotree.GetStatusLine() : ""}')
  13. else
  14. call airline#extensions#apply_left_override('undotree', '%f')
  15. endif
  16. endif
  17. if &ft == 'diff' && exists('*t:diffpanel.GetStatusLine')
  18. call airline#extensions#apply_left_override('diff', '%{exists("t:diffpanel") ? t:diffpanel.GetStatusLine() : ""}')
  19. endif
  20. endif
  21. endfunction
  22. function! airline#extensions#undotree#init(ext)
  23. call a:ext.add_statusline_func('airline#extensions#undotree#apply')
  24. endfunction