indent.vim 463 B

12345678910111213141516
  1. function! pandoc#indent#Init() abort
  2. runtime! indent/tex.vim
  3. if exists('#LatexBox_Completion#CompleteDone')
  4. au! LatexBox_Completion CompleteDone
  5. endif
  6. setlocal indentexpr=pandoc#indent#GetIndent()
  7. endfunction
  8. function! pandoc#indent#GetIndent() abort
  9. let l:stack = synstack(line('.'), col('.'))
  10. if len(l:stack) > 0 && synIDattr(l:stack[0], 'name') ==# 'pandocLaTeXRegion'
  11. return GetTeXIndent()
  12. else
  13. return -1
  14. endif
  15. endfunction