comparison runtime/indent/fortran.vim @ 10244:876fbdd84e52

commit https://github.com/vim/vim/commit/2ec618c9feac4573b154510236ad8121c77d0eca Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 1 14:47:05 2016 +0200 Updated runtime files.
author Christian Brabandt <cb@256bit.org>
date Sat, 01 Oct 2016 15:00:04 +0200
parents 43efa4f5a8ea
children 368468ef35cf
comparison
equal deleted inserted replaced
10243:fe057ff11e5f 10244:876fbdd84e52
1 " Vim indent file 1 " Vim indent file
2 " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77) 2 " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
3 " Version: 0.45 3 " Version: 0.46
4 " Last Change: 2016 Aug. 29 4 " Last Change: 2016 Sep. 27
5 " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/> 5 " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
6 " Usage: For instructions, do :help fortran-indent from Vim 6 " Usage: For instructions, do :help fortran-indent from Vim
7 " Credits: 7 " Credits:
8 " Useful suggestions were made by: Albert Oliver Serra and Takuya Fujiwara. 8 " Useful suggestions were made, in chronological order, by:
9 " Albert Oliver Serra, Takuya Fujiwara and Philipp Edelmann.
9 10
10 " Only load this indent file when no other was loaded. 11 " Only load this indent file when no other was loaded.
11 if exists("b:did_indent") 12 if exists("b:did_indent")
12 finish 13 finish
13 endif 14 endif
119 "Indent program units unless instructed otherwise 120 "Indent program units unless instructed otherwise
120 if !exists("b:fortran_indent_less") && !exists("g:fortran_indent_less") 121 if !exists("b:fortran_indent_less") && !exists("g:fortran_indent_less")
121 let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}' 122 let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}'
122 let type='\(\(integer\|real\|double\s\+precision\|complex\|logical' 123 let type='\(\(integer\|real\|double\s\+precision\|complex\|logical'
123 \.'\|character\|type\|class\)\s*\S*\s\+\)\=' 124 \.'\|character\|type\|class\)\s*\S*\s\+\)\='
124 if prevstat =~? '^\s*\(module\|contains\/submodule\|program\)\>' 125 if prevstat =~? '^\s*\(contains\|submodule\|program\)\>'
126 \ ||prevstat =~? '^\s*'.'module\>\(\s*\procedure\)\@!'
125 \ ||prevstat =~? '^\s*'.prefix.'subroutine\>' 127 \ ||prevstat =~? '^\s*'.prefix.'subroutine\>'
126 \ ||prevstat =~? '^\s*'.prefix.type.'function\>' 128 \ ||prevstat =~? '^\s*'.prefix.type.'function\>'
127 \ ||prevstat =~? '^\s*'.type.prefix.'function\>' 129 \ ||prevstat =~? '^\s*'.type.prefix.'function\>'
128 let ind = ind + shiftwidth() 130 let ind = ind + shiftwidth()
129 endif 131 endif
130 if getline(v:lnum) =~? '^\s*contains\>' 132 if getline(v:lnum) =~? '^\s*contains\>'
131 \ ||getline(v:lnum)=~? '^\s*end\s*' 133 \ ||getline(v:lnum)=~? '^\s*end\s*'
132 \ .'\(function\|subroutine\|module\/submodule\|program\)\>' 134 \ .'\(function\|subroutine\|module\|submodule\|program\)\>'
133 let ind = ind - shiftwidth() 135 let ind = ind - shiftwidth()
134 endif 136 endif
135 endif 137 endif
136 138
137 "Subtract a shiftwidth from else, else if, elsewhere, case, end if, 139 "Subtract a shiftwidth from else, else if, elsewhere, case, end if,