Update runtime files.

This commit is contained in:
Bram Moolenaar
2016-01-28 22:38:53 +01:00
parent 3b5f929b18
commit 298b440930
8 changed files with 106 additions and 62 deletions

View File

@ -1,11 +1,11 @@
" Vim indent file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
" Version: 0.42
" Last Change: 2015 Nov. 30
" Version: 0.44
" Last Change: 2016 Jan. 26
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-indent from Vim
" Credits:
" Useful suggestions were made by: Albert Oliver Serra.
" Useful suggestions were made by: Albert Oliver Serra and Takuya Fujiwara.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@ -92,10 +92,10 @@ function FortranGetIndent(lnum)
"Indent do loops only if they are all guaranteed to be of do/end do type
if exists("b:fortran_do_enddo") || exists("g:fortran_do_enddo")
if prevstat =~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*do\>'
let ind = ind + &sw
let ind = ind + shiftwidth()
endif
if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*end\s*do\>'
let ind = ind - &sw
let ind = ind - shiftwidth()
endif
endif
@ -105,14 +105,14 @@ function FortranGetIndent(lnum)
\ ||prevstat=~? '^\s*\(type\|interface\|associate\|enum\)\>'
\ ||prevstat=~?'^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*\(forall\|where\|block\)\>'
\ ||prevstat=~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*if\>'
let ind = ind + &sw
let ind = ind + shiftwidth()
" Remove unwanted indent after logical and arithmetic ifs
if prevstat =~? '\<if\>' && prevstat !~? '\<then\>'
let ind = ind - &sw
let ind = ind - shiftwidth()
endif
" Remove unwanted indent after type( statements
if prevstat =~? '^\s*type\s*('
let ind = ind - &sw
let ind = ind - shiftwidth()
endif
endif
@ -125,12 +125,12 @@ function FortranGetIndent(lnum)
\ ||prevstat =~? '^\s*'.prefix.'subroutine\>'
\ ||prevstat =~? '^\s*'.prefix.type.'function\>'
\ ||prevstat =~? '^\s*'.type.prefix.'function\>'
let ind = ind + &sw
let ind = ind + shiftwidth()
endif
if getline(v:lnum) =~? '^\s*contains\>'
\ ||getline(v:lnum)=~? '^\s*end\s*'
\ .'\(function\|subroutine\|module\|program\)\>'
let ind = ind - &sw
let ind = ind - shiftwidth()
endif
endif
@ -141,23 +141,23 @@ function FortranGetIndent(lnum)
\. '\(else\|else\s*if\|else\s*where\|case\|'
\. 'end\s*\(if\|where\|select\|interface\|'
\. 'type\|forall\|associate\|enum\|block\)\)\>'
let ind = ind - &sw
let ind = ind - shiftwidth()
" Fix indent for case statement immediately after select
if prevstat =~? '\<select\s\+\(case\|type\)\>'
let ind = ind + &sw
let ind = ind + shiftwidth()
endif
endif
"First continuation line
if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
let ind = ind + &sw
let ind = ind + shiftwidth()
endif
if prevstat =~ '&\s*$' && prevstat =~ '\<else\s*if\>'
let ind = ind - &sw
let ind = ind - shiftwidth()
endif
"Line after last continuation line
if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
let ind = ind - &sw
let ind = ind - shiftwidth()
endif
return ind

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Zimbu
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Sep 08
" Last Change: 2016 Jan 25
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@ -74,9 +74,9 @@ func GetZimbuIndent(lnum)
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\|Char\\)$'")
if pp > 0
return indent(prevLnum) + &sw
return indent(prevLnum) + shiftwidth()
endif
return indent(prevLnum) + &sw * 2
return indent(prevLnum) + shiftwidth() * 2
endif
if plnumstart == p
return indent(prevLnum)
@ -102,13 +102,13 @@ func GetZimbuIndent(lnum)
endif
if prevline =~ '^\s*\(IF\|\|ELSEIF\|ELSE\|GENERATE_IF\|\|GENERATE_ELSEIF\|GENERATE_ELSE\|WHILE\|REPEAT\|TRY\|CATCH\|FINALLY\|FOR\|DO\|SWITCH\|CASE\|DEFAULT\|FUNC\|VIRTUAL\|ABSTRACT\|DEFINE\|REPLACE\|FINAL\|PROC\|MAIN\|NEW\|ENUM\|CLASS\|INTERFACE\|BITS\|MODULE\|SHARED\)\>'
let plindent += &sw
let plindent += shiftwidth()
endif
if thisline =~ '^\s*\(}\|ELSEIF\>\|ELSE\>\|CATCH\|FINALLY\|GENERATE_ELSEIF\>\|GENERATE_ELSE\>\|UNTIL\>\)'
let plindent -= &sw
let plindent -= shiftwidth()
endif
if thisline =~ '^\s*\(CASE\>\|DEFAULT\>\)' && prevline !~ '^\s*SWITCH\>'
let plindent -= &sw
let plindent -= shiftwidth()
endif
" line up continued comment that started after some code