summaryrefslogtreecommitdiff
path: root/runtime/ftplugin/fortran.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin/fortran.vim')
-rw-r--r--runtime/ftplugin/fortran.vim8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim
index 26dc90a18..8f5b243b8 100644
--- a/runtime/ftplugin/fortran.vim
+++ b/runtime/ftplugin/fortran.vim
@@ -1,6 +1,6 @@
" Vim settings file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
-" Version: (v53) 2021 April 06
+" Version: (v53) 2021 April 06 (updated 2022 May 22)
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-plugin from Vim
" Credits:
@@ -105,12 +105,13 @@ if !exists("b:match_words")
let s:notselect = '\%(\<select\s\+\)\@<!'
let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!'
let s:notprocedure = '\%(\s\+procedure\>\)\@!'
+ let s:nothash = '\%(^\s*#\s*\)\@<!'
let b:match_ignorecase = 1
let b:match_words =
\ '(:),' .
\ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' .
\ s:notelse . '\<if\s*(.\+)\s*then\>:' .
- \ '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:\<end\s*if\>,'.
+ \ s:nothash . '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:' . s:nothash . '\<end\s*if\>,'.
\ 'do\s\+\(\d\+\):\%(^\s*\)\@<=\1\s,'.
\ s:notend . '\<do\>:\<end\s*do\>,'.
\ s:notelse . '\<where\>:\<elsewhere\>:\<end\s*where\>,'.
@@ -122,7 +123,8 @@ if !exists("b:match_words")
\ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'.
\ s:notend . '\<function\>:\<end\s*function\>,'.
\ s:notend . '\<module\>' . s:notprocedure . ':\<end\s*module\>,'.
- \ s:notend . '\<program\>:\<end\s*program\>'
+ \ s:notend . '\<program\>:\<end\s*program\>,'.
+ \ '\%(^\s*\)\@<=#\s*if\%(def\|ndef\)\=\>:\%(^\s*\)\@<=#\s*\%(elif\|else\)\>:\%(^\s*\)\@<=#\s*endif\>'
endif
" File filters for :browse e