indent: Use g:tex_noindent_env and g:tex_itemize_env again

This fixes the accidental removal of the variables in commit
521fc199bd
This commit is contained in:
Till Maas
2013-01-16 15:30:08 +01:00
parent a3f7af9c02
commit 2ef995684d
+8 -15
View File
@@ -160,8 +160,8 @@ function GetTeXIndent()
endif
" Add a 'shiftwidth' after beginning of environments.
" Don't add it for \begin{document} and \begin{verbatim}
""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
" Don't add it for environments identified by
" g:tex_noindent_env
" LH modification : \begin does not always start a line
let current_regexp = '\\begin'
while 1
@@ -170,15 +170,12 @@ function GetTeXIndent()
break
endif
let environment_type = get(match_list, 1)
if environment_type !~ '^\s*verbatim'
\ && environment_type !~ '^\s*document'
\ && environment_type !~ '^\s*comment'
if environment_type !~ g:tex_noindent_env
let ind = ind + &sw
if g:tex_indent_items == 1
" Add another sw for item-environments
if line =~ 'itemize\|description\|enumerate\|thebibliography'
if line =~ g:tex_itemize_env
let ind = ind + &sw
endif
endif
@@ -188,13 +185,11 @@ function GetTeXIndent()
endwhile
" Subtract a 'shiftwidth' when an environment ends
if cline =~ '^\s*\\end' && cline !~ 'verbatim'
\&& cline !~ 'document'
\&& cline !~ 'comment'
if cline =~ '^\s*\\end' && cline !~ g:tex_noindent_env
if g:tex_indent_items == 1
" Remove another sw for item-environments
if cline =~ 'itemize\|description\|enumerate\|thebibliography'
if cline =~ g:tex_itemize_env
let ind = ind - &sw
endif
endif
@@ -212,9 +207,7 @@ function GetTeXIndent()
break
endif
let environment_type = get(match_list, 1)
if environment_type !~ '^\s*verbatim'
\ && environment_type !~ '^\s*document'
\ && environment_type !~ '^\s*comment'
if environment_type !~ g:tex_noindent_env
\ && (current_regexp != '\\end' || line !~ '^\s*\\end')
" If the end begin the line, the shift width has already
" been subtracted at the previous line
@@ -223,7 +216,7 @@ function GetTeXIndent()
if g:tex_indent_items == 1
" Add another sw for item-environments
if line =~ 'itemize\|description\|enumerate\|thebibliography'
if line =~ g:tex_itemize_env
let ind = ind - &sw
endif
endif