diff runtime/indent/teraterm.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 2b6654519a7c
children 34fd018452ed
line wrap: on
line diff
--- a/runtime/indent/teraterm.vim
+++ b/runtime/indent/teraterm.vim
@@ -3,7 +3,7 @@
 "		Based on Tera Term Version 4.92
 " Maintainer:	Ken Takata
 " URL:		https://github.com/k-takata/vim-teraterm
-" Last Change:	2016 Aug 17
+" Last Change:	2017 Jun 13
 " Filenames:	*.ttl
 " License:	VIM License
 
@@ -22,16 +22,6 @@ if exists("*GetTeraTermIndent")
   finish
 endif
 
-" The shiftwidth() function is relatively new.
-" Don't require it to exist.
-if exists('*shiftwidth')
-  let s:sw = function('shiftwidth')
-else
-  function s:sw() abort
-    return &shiftwidth
-  endfunction
-endif
-
 function! GetTeraTermIndent(lnum)
   let l:prevlnum = prevnonblank(a:lnum-1)
   if l:prevlnum == 0
@@ -48,15 +38,15 @@ function! GetTeraTermIndent(lnum)
 
   if l:prevl =~ '^\s*if\>.*\<then\>'
     " previous line opened a block
-    let l:ind += s:sw()
+    let l:ind += shiftwidth()
   endif
   if l:prevl =~ '^\s*\%(elseif\|else\|do\|until\|while\|for\)\>'
     " previous line opened a block
-    let l:ind += s:sw()
+    let l:ind += shiftwidth()
   endif
   if l:thisl =~ '^\s*\%(elseif\|else\|endif\|enduntil\|endwhile\|loop\|next\)\>'
     " this line closed a block
-    let l:ind -= s:sw()
+    let l:ind -= shiftwidth()
   endif
 
   return l:ind