diff options
Diffstat (limited to 'runtime/indent/teraterm.vim')
-rw-r--r-- | runtime/indent/teraterm.vim | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/runtime/indent/teraterm.vim b/runtime/indent/teraterm.vim index ba24257b02..370283c77f 100644 --- a/runtime/indent/teraterm.vim +++ b/runtime/indent/teraterm.vim @@ -1,9 +1,9 @@ " Vim indent file " Language: Tera Term Language (TTL) -" Based on Tera Term Version 4.86 +" Based on Tera Term Version 4.92 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2015 Jun 4 +" Last Change: 2017 Jun 13 " Filenames: *.ttl " License: VIM License @@ -22,18 +22,6 @@ if exists("*GetTeraTermIndent") finish endif -" The shiftwidth() function is relatively new. -" Don't require it to exist. -if exists('*shiftwidth') - function s:sw() abort - return shiftwidth() - endfunction -else - function s:sw() abort - return &shiftwidth - endfunction -endif - function! GetTeraTermIndent(lnum) let l:prevlnum = prevnonblank(a:lnum-1) if l:prevlnum == 0 @@ -48,17 +36,17 @@ function! GetTeraTermIndent(lnum) let l:ind = l:previ - if l:prevl =~ '^\s*if\>.*\<then\s*$' + 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 |