Guest User

Untitled

a guest
Jan 22nd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. diff --git a/autoload/caw.vim b/autoload/caw.vim
  2. index 49e8c7a..ce44bfd 100644
  3. --- a/autoload/caw.vim
  4. +++ b/autoload/caw.vim
  5. @@ -86,21 +86,24 @@ endfunction "}}}
  6.  
  7.  
  8. function! s:get_indent_num(lnum) "{{{
  9. - if has('cindent') && &syntax =~# '\<c\|cpp\>'
  10. - return cindent(a:lnum)
  11. - elseif has('lispindent') && &syntax =~# '\<lisp\|scheme\>'
  12. - return lispindent(a:lnum)
  13. - elseif &l:indentexpr != ''
  14. + if &l:indentexpr != ''
  15. let save_view = winsaveview()
  16. let save_lnum = v:lnum
  17. let v:lnum = a:lnum
  18. try
  19. return eval(&l:indentexpr)
  20. + catch
  21. + " fallback to other strategies...
  22. finally
  23. let v:lnum = save_lnum
  24. " NOTE: GetPythonIndent() moves cursor. wtf?
  25. call winrestview(save_view)
  26. endtry
  27. + endif
  28. + if has('cindent') && &syntax =~# '\<c\|cpp\>'
  29. + return cindent(a:lnum)
  30. + elseif has('lispindent') && &syntax =~# '\<lisp\|scheme\>'
  31. + return lispindent(a:lnum)
  32. else
  33. return indent(a:lnum)
  34. endif
Add Comment
Please, Sign In to add comment