From 910f66f90c928da8b607ccfdc12fc33d9cb8d4a9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 5 Apr 2006 20:41:53 +0000 Subject: updated for version 7.0c10 --- runtime/indent/fortran.vim | 12 ++++++------ runtime/indent/python.vim | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'runtime/indent') diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim index b14273aa32..465412b167 100644 --- a/runtime/indent/fortran.vim +++ b/runtime/indent/fortran.vim @@ -2,7 +2,7 @@ " Language: Fortran95 (and Fortran90, Fortran77, F and elf90) " Version: 0.36 " URL: http://www.unb.ca/chem/ajit/indent/fortran.vim -" Last Change: 2004 Apr. 05 +" Last Change: 2006 Apr. 02 " Maintainer: Ajit J. Thakkar ; " Usage: Do :help fortran-indent from Vim @@ -12,9 +12,6 @@ if exists("b:did_indent") endif let b:did_indent = 1 -let s:cposet=&cpoptions -set cpoptions-=C - setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect @@ -30,11 +27,11 @@ if !exists("b:fortran_fixed_source") else " f90 and f95 allow both fixed and free source form " assume fixed source form unless signs of free source form - " are detected in the first five columns of the first 25 lines + " are detected in the first five columns of the first 250 lines " Detection becomes more accurate and time-consuming if more lines " are checked. Increase the limit below if you keep lots of comments at " the very top of each file and you have a fast computer - let s:lmax = 25 + let s:lmax = 250 if ( s:lmax > line("$") ) let s:lmax = line("$") endif @@ -64,6 +61,9 @@ else endif endif +let s:cposet=&cpoptions +set cpoptions-=C + function FortranGetIndent(lnum) let ind = indent(a:lnum) let prevline=getline(a:lnum) diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim index 3b560a8a7e..f268bf9e50 100644 --- a/runtime/indent/python.vim +++ b/runtime/indent/python.vim @@ -56,7 +56,7 @@ function GetPythonIndent(lnum) " Trick: use the non-existing "dummy" variable to break out of the loop when " going too far back. call cursor(plnum, 1) - let parlnum = searchpair('(', '', ')', 'nbW', + let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|String\\)$'") @@ -75,14 +75,14 @@ function GetPythonIndent(lnum) " + b " + c) call cursor(a:lnum, 1) - let p = searchpair('(', '', ')', 'bW', + let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|String\\)$'") if p > 0 if p == plnum " When the start is inside parenthesis, only indent one 'shiftwidth'. - let pp = searchpair('(', '', ')', 'bW', + let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|String\\)$'") -- cgit v1.2.3