diff runtime/indent/tex.vim @ 11518:63b0b7b79b25

Update runtime files. commit https://github.com/vim/vim/commit/3ec574f2b549f456f664f689d6da36dc5719aeb9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 13 18:12:01 2017 +0200 Update runtime files. Includes changing &sw to shiftwidth() for all indent scripts.
author Christian Brabandt <cb@256bit.org>
date Tue, 13 Jun 2017 18:15:04 +0200
parents d183d629509e
children a62eeee5f116
line wrap: on
line diff
--- a/runtime/indent/tex.vim
+++ b/runtime/indent/tex.vim
@@ -215,14 +215,14 @@ function! GetTeXIndent() " {{{
     " ZYC modification : \end after \begin won't cause wrong indent anymore
     if line =~ '\\begin{.*}' 
         if line !~ g:tex_noindent_env
-            let ind = ind + &sw
+            let ind = ind + shiftwidth()
             let stay = 0
         endif
 
         if g:tex_indent_items
             " Add another sw for item-environments
             if line =~ g:tex_itemize_env
-                let ind = ind + &sw
+                let ind = ind + shiftwidth()
                 let stay = 0
             endif
         endif
@@ -241,23 +241,23 @@ function! GetTeXIndent() " {{{
         if g:tex_indent_items
             " Remove another sw for item-environments
             if cline =~ g:tex_itemize_env
-                let ind = ind - &sw
+                let ind = ind - shiftwidth()
                 let stay = 0
             endif
         endif
 
-        let ind = ind - &sw
+        let ind = ind - shiftwidth()
         let stay = 0
     endif
 
     if g:tex_indent_brace
         if line =~ '[[{]$'
-            let ind += &sw
+            let ind += shiftwidth()
             let stay = 0
         endif
 
         if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum))
-            let ind -= &sw
+            let ind -= shiftwidth()
             let stay = 0
         endif
 
@@ -266,7 +266,7 @@ function! GetTeXIndent() " {{{
                 let char = line[i]
                 if char == ']' || char == '}'
                     if s:CheckPairedIsLastCharacter(lnum, i)
-                        let ind -= &sw
+                        let ind -= shiftwidth()
                         let stay = 0
                     endif
                 endif
@@ -280,12 +280,12 @@ function! GetTeXIndent() " {{{
     if g:tex_indent_items
         " '\item' or '\bibitem' itself:
         if cline =~ g:tex_items
-            let ind = ind - &sw
+            let ind = ind - shiftwidth()
             let stay = 0
         endif
         " lines following to '\item' are intented once again:
         if line =~ g:tex_items
-            let ind = ind + &sw
+            let ind = ind + shiftwidth()
             let stay = 0
         endif
     endif
@@ -317,9 +317,9 @@ function! s:GetLastBeginIndentation(lnum
                 return indent(lnum)
             endif
             if line =~ g:tex_itemize_env
-                return indent(lnum) + 2 * &sw
+                return indent(lnum) + 2 * shiftwidth()
             endif
-            return indent(lnum) + &sw
+            return indent(lnum) + shiftwidth()
         endif
     endfor
     return -1
@@ -347,7 +347,7 @@ function! s:GetEndIndentation(lnum) " {{
             let min_indent = min([min_indent, indent(lnum)])
         endif
     endfor
-    return min_indent - &sw
+    return min_indent - shiftwidth()
 endfunction
 
 " Most of the code is from matchparen.vim