summaryrefslogtreecommitdiffstats
path: root/runtime/indent/fortran.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-22 22:33:57 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-22 22:33:57 +0000
commiteb3593b38b7b6b658e93ad05d6caf76d58cc0c35 (patch)
tree39210f19a86e4db2914523b0fde4a5ff9d345c16 /runtime/indent/fortran.vim
parent57657d85c6c3d812e99b5e5d5161c07c66ac7dc7 (diff)
updated for version 7.0e06v7.0e06
Diffstat (limited to 'runtime/indent/fortran.vim')
-rw-r--r--runtime/indent/fortran.vim16
1 files changed, 11 insertions, 5 deletions
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
index 465412b167..94b9da1777 100644
--- a/runtime/indent/fortran.vim
+++ b/runtime/indent/fortran.vim
@@ -1,8 +1,8 @@
" Vim indent file
" Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
-" Version: 0.36
+" Version: 0.37
" URL: http://www.unb.ca/chem/ajit/indent/fortran.vim
-" Last Change: 2006 Apr. 02
+" Last Change: 2006 Apr. 22
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
" Usage: Do :help fortran-indent from Vim
@@ -14,6 +14,7 @@ let b:did_indent = 1
setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select
setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect
+setlocal indentkeys+==~type,=~interface
" Determine whether this is a fixed or free format source file
" if this hasn't been done yet
@@ -81,20 +82,25 @@ function FortranGetIndent(lnum)
endif
"Add a shiftwidth to statements following if, else, case,
- "where and elsewhere statements
+ "where, elsewhere, type and interface statements
if prevstat =~? '^\s*\(\d\+\s\)\=\s*\(else\|case\|where\|elsewhere\)\>'
+ \ ||prevstat =~? '^\s*\(\d\+\s\)\=\s*\(type\|interface\)\>'
\ || prevstat =~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*if\>'
let ind = ind + &sw
" Remove unwanted indent after logical and arithmetic ifs
if prevstat =~? '\<if\>' && prevstat !~? '\<then\>'
let ind = ind - &sw
endif
+ " Remove unwanted indent after type( statements
+ if prevstat =~? '\<type\s*('
+ let ind = ind - &sw
+ endif
endif
"Subtract a shiftwidth from else, elsewhere, case, end if,
- " end where and end select statements
+ " end where, end select, end interface and end type statements
if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*'
- \. '\(else\|elsewhere\|case\|end\s*\(if\|where\|select\)\)\>'
+ \. '\(else\|elsewhere\|case\|end\s*\(if\|where\|select\|interface\|type\)\)\>'
let ind = ind - &sw
" Fix indent for case statement immediately after select
if prevstat =~? '\<select\>'