aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/fortran.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-04 19:18:16 -0400
committerGitHub <noreply@github.com>2021-05-04 19:18:16 -0400
commit4ad30f775e5564c539324b4818886f067d2ecd99 (patch)
tree97a554379bda7e5fc77e58c690db3f5a72db8c74 /runtime/indent/fortran.vim
parent63d8a8f4e8b02e524d85aed08aa16c5d9815598c (diff)
parentd5b063aec1db95704b37a77fdbd968cb6b48cc3b (diff)
downloadrneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.gz
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.bz2
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.zip
Merge pull request #14424 from janlazo/vim-8.1.1726
vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
Diffstat (limited to 'runtime/indent/fortran.vim')
-rw-r--r--runtime/indent/fortran.vim21
1 files changed, 13 insertions, 8 deletions
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
index 2ba69e86df..26ed33a54d 100644
--- a/runtime/indent/fortran.vim
+++ b/runtime/indent/fortran.vim
@@ -1,12 +1,13 @@
" Vim indent file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
-" Version: 47
-" Last Change: 2016 Oct. 29
+" Version: (v48) 2020 October 07
" 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, in chronological order, by:
-" Albert Oliver Serra, Takuya Fujiwara and Philipp Edelmann.
+" Version 0.1 was created in September 2000 by Ajit Thakkar.
+" Since then, useful suggestions and contributions have been made, in order, by:
+" Albert Oliver Serra, Takuya Fujiwara, Philipp Edelmann, Eisuke Kawashima,
+" and Louis Cochen.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -39,10 +40,10 @@ if !exists("b:fortran_fixed_source")
elseif exists("fortran_fixed_source")
" User guarantees fixed source form
let b:fortran_fixed_source = 1
- elseif expand("%:e") ==? "f\<90\|95\|03\|08\>"
+ elseif expand("%:e") =~? '^f\%(90\|95\|03\|08\)$'
" Free-form file extension defaults as in Intel ifort, gcc(gfortran), NAG, Pathscale, and Cray compilers
let b:fortran_fixed_source = 0
- elseif expand("%:e") ==? "f\|f77\|for"
+ elseif expand("%:e") =~? '^\%(f\|f77\|for\)$'
" Fixed-form file extension defaults
let b:fortran_fixed_source = 1
else
@@ -73,11 +74,15 @@ endif
if (b:fortran_fixed_source == 1)
setlocal indentexpr=FortranGetFixedIndent()
if exists("*FortranGetFixedIndent")
+ let &cpoptions = s:cposet
+ unlet s:cposet
finish
endif
else
setlocal indentexpr=FortranGetFreeIndent()
if exists("*FortranGetFreeIndent")
+ let &cpoptions = s:cposet
+ unlet s:cposet
finish
endif
endif
@@ -145,7 +150,7 @@ function FortranGetIndent(lnum)
\. 'type\|forall\|associate\|enum\|block\)\)\>'
let ind = ind - shiftwidth()
" Fix indent for case statement immediately after select
- if prevstat =~? '\<select\s\+\(case\|type\)\>'
+ if prevstat =~? '\<select\s*\(case\|type\)\>'
let ind = ind + shiftwidth()
endif
endif
@@ -212,7 +217,7 @@ function FortranGetFixedIndent()
return ind
endfunction
-let &cpoptions=s:cposet
+let &cpoptions = s:cposet
unlet s:cposet
" vim:sw=2 tw=130