summaryrefslogtreecommitdiff
path: root/runtime/indent
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-02-26 23:04:13 +0000
committerBram Moolenaar <Bram@vim.org>2005-02-26 23:04:13 +0000
commit05159a0c6a27a030c8497c5cf836977090f9e75d (patch)
tree9ccc167cf3e830e5d01aff4555f99d854cbb623b /runtime/indent
parent5313dcb75ac76501f23d21ac94efdbeeabc860bc (diff)
downloadvim-git-05159a0c6a27a030c8497c5cf836977090f9e75d.tar.gz
updated for version 7.0052v7.0052
Diffstat (limited to 'runtime/indent')
-rw-r--r--runtime/indent/python.vim11
-rw-r--r--runtime/indent/vim.vim4
2 files changed, 9 insertions, 6 deletions
diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim
index e0e8e71f1..38ef1d259 100644
--- a/runtime/indent/python.vim
+++ b/runtime/indent/python.vim
@@ -2,7 +2,7 @@
" Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu>
-" Last Change: 2005 Feb 08
+" Last Change: 2005 Feb 24
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -22,16 +22,19 @@ if exists("*GetPythonIndent")
finish
endif
+" Come here when loading the script the first time.
+
let s:maxoff = 50 " maximum number of lines to look backwards for ()
function GetPythonIndent(lnum)
+
" If this line is explicitly joined: If the previous line was also joined,
" line it up with that one, otherwise add two 'shiftwidth'
if getline(a:lnum - 1) =~ '\\$'
if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$'
return indent(a:lnum - 1)
endif
- return indent(a:lnum - 1) + (&sw * 2)
+ return indent(a:lnum - 1) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (&sw * 2))
endif
" If the start of the line is in a string don't change the indent.
@@ -84,9 +87,9 @@ function GetPythonIndent(lnum)
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'")
if pp > 0
- return indent(plnum) + &sw
+ return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : &sw)
endif
- return indent(plnum) + (&sw * 2)
+ return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (&sw * 2))
endif
if plnumstart == p
return indent(plnum)
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim
index 08d8ebf63..c96298de3 100644
--- a/runtime/indent/vim.vim
+++ b/runtime/indent/vim.vim
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Vim script
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2004 Sep 02
+" Last Change: 2005 Feb 25
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -44,7 +44,7 @@ function GetVimIndent()
else
let ind = ind + &sw * 3
endif
- elseif getline(lnum) =~ '\(^\||\)\s*\(if\|wh\%[ile]\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>'
+ elseif getline(lnum) =~ '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>'
let ind = ind + &sw
elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~ '^\s*aug\%[roup]\s*!\=\s\+END'
let ind = ind + &sw