autoloclist.vim 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. if exists('g:loaded_syntastic_notifier_autoloclist') || !exists('g:loaded_syntastic_plugin')
  2. finish
  3. endif
  4. let g:loaded_syntastic_notifier_autoloclist = 1
  5. let g:SyntasticAutoloclistNotifier = {}
  6. " Public methods {{{1
  7. "
  8. function! g:SyntasticAutoloclistNotifier.New() abort " {{{2
  9. let newObj = copy(self)
  10. return newObj
  11. endfunction " }}}2
  12. function! g:SyntasticAutoloclistNotifier.refresh(loclist) abort " {{{2
  13. call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: refresh')
  14. call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
  15. endfunction " }}}2
  16. function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2
  17. call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: toggle')
  18. if !a:loclist.isEmpty()
  19. if syntastic#util#var('auto_loc_list') == 1
  20. call a:loclist.show()
  21. endif
  22. else
  23. if syntastic#util#var('auto_loc_list') > 0
  24. "TODO: this will close the loc list window if one was opened by
  25. "something other than syntastic
  26. lclose
  27. endif
  28. endif
  29. endfunction " }}}2
  30. " }}}1
  31. " vim: set sw=4 sts=4 et fdm=marker: