diff --git a/indent/tex.vim b/indent/tex.vim index b0a3c20..7492b50 100644 --- a/indent/tex.vim +++ b/indent/tex.vim @@ -113,7 +113,11 @@ endfunction " }}}1 function! s:indent_tikz(lnum, prev) " {{{1 - if vimtex#env#is_inside('tikzpicture') + let l:winview = winsaveview() + let l:inside_tikzpicture = vimtex#env#is_inside('tikzpicture') + call winrestview(l:winview) + + if l:inside_tikzpicture let l:prev_starts = a:prev =~# s:tikz_commands let l:prev_stops = a:prev =~# ';\s*$'