aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/fortran.vim
diff options
context:
space:
mode:
authorKillTheMule <KillTheMule@users.noreply.github.com>2016-05-03 21:16:53 +0200
committerKillTheMule <KillTheMule@users.noreply.github.com>2016-05-03 21:22:45 +0200
commit7b29dfc43a0220cfc20d657e68eeddaa0d1d3674 (patch)
tree5adde1502b16d953d6ef48cea485e4e3e7209d45 /runtime/syntax/fortran.vim
parentb634cfcc196fef0b17c48f9669c4e2eb7a1fcc26 (diff)
downloadrneovim-7b29dfc43a0220cfc20d657e68eeddaa0d1d3674.tar.gz
rneovim-7b29dfc43a0220cfc20d657e68eeddaa0d1d3674.tar.bz2
rneovim-7b29dfc43a0220cfc20d657e68eeddaa0d1d3674.zip
vim-patch:256972a
Updated runtime files. https://github.com/vim/vim/commit/256972a9849b5d575b62a6a71be5b6934b5b0e8b Missing files in runtime/doc: todo.txt, tags. Patch to runtime/doc/syntax.txt was applied manually in part, for no discernible reason.
Diffstat (limited to 'runtime/syntax/fortran.vim')
-rw-r--r--runtime/syntax/fortran.vim22
1 files changed, 14 insertions, 8 deletions
diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim
index 120a999404..26d063524e 100644
--- a/runtime/syntax/fortran.vim
+++ b/runtime/syntax/fortran.vim
@@ -1,12 +1,12 @@
" Vim syntax file
-" Language: Fortran 2008 (and earlier versions: 2003, 95, 90, and 77)
-" Version: 0.95
-" Last Change: 2015 Jan. 15
+" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
+" Version: 0.96
+" Last Change: 2015 Nov. 30
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-syntax from Vim
" Credits:
" Version 0.1 was based on the fortran 77 syntax file by Mario Eusebio and
-" Preben Guldberg. Useful suggestions were made by: Andrej Panjkov,
+" Preben Guldberg. Useful suggestions and contributions were made by: Andrej Panjkov,
" Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
" Andrew Griffiths, Joe Krahn, Hendrik Merx, and Matt Thompson.
@@ -19,8 +19,8 @@ let s:cpo_save = &cpo
set cpo&vim
" Choose fortran_dialect using the priority:
-" source file directive > buffer-local value > global value > default
-" try using directive in first three lines of file
+" source file directive > buffer-local value > global value > file extension
+" first try using directive in first three lines of file
let b:fortran_retype = getline(1)." ".getline(2)." ".getline(3)
if b:fortran_retype =~? '\<fortran_dialect\s*=\s*F\>'
let b:fortran_dialect = "F"
@@ -51,6 +51,12 @@ if !exists("b:fortran_fixed_source")
elseif exists("fortran_fixed_source")
" User guarantees fixed source form for all fortran files
let b:fortran_fixed_source = 1
+ 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"
+ " Fixed-form file extension defaults
+ let b:fortran_fixed_source = 1
else
" Modern fortran still allows both free and fixed source form.
" Assume fixed source form unless signs of free source form
@@ -67,8 +73,8 @@ if !exists("b:fortran_fixed_source")
while s:ln <= s:lmax
let s:test = strpart(getline(s:ln),0,5)
if s:test !~ '^[Cc*]' && s:test !~ '^ *[!#]' && s:test =~ '[^ 0-9\t]' && s:test !~ '^[ 0-9]*\t'
- let b:fortran_fixed_source = 0
- break
+ let b:fortran_fixed_source = 0
+ break
endif
let s:ln = s:ln + 1
endwhile