Fix more 'cpo' issues in runtime files.

This commit is contained in:
Bram Moolenaar
2012-05-18 21:49:28 +02:00
parent bd1d560895
commit 8e52a59376
25 changed files with 122 additions and 70 deletions

View File

@ -23,6 +23,8 @@ setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
if exists("*CMakeGetIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
fun! CMakeGetIndent(lnum)
let this_line = getline(a:lnum)
@ -83,3 +85,6 @@ fun! CMakeGetIndent(lnum)
return ind
endfun
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@ -15,6 +15,8 @@ setlocal nosmartindent
if exists("*GetCSSIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
function s:prevnonblanknoncomment(lnum)
let lnum = a:lnum
@ -74,3 +76,6 @@ function GetCSSIndent()
return indent(pnum) + s:count_braces(pnum, 1) * &sw
\ - s:count_braces(v:lnum, 0) * &sw
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@ -5,7 +5,7 @@
" $Date: 2004/12/09 21:33:52 $
" $Revision: 1.3 $
" URL: http://www.djoce.net/page/vim/
" Last Change: 2004 Sept 14 : removed specific value for tab (sw)
" Last Change: 2012 May 18
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@ -37,6 +37,8 @@ let s:inheritance_dent = '\s*\(redefine\|rename\|export\)\>'
if exists("*GetEiffelIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
function GetEiffelIndent()
@ -103,4 +105,7 @@ function GetEiffelIndent()
return ind
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:sw=2

View File

@ -1,6 +1,6 @@
" IDL (Interactive Data Language) indent file.
" Language: IDL (ft=idlang)
" Last change: 2002 Sep 23
" Last change: 2012 May 18
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Only load this indent file when no other was loaded.
@ -9,8 +9,7 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
setlocal indentkeys=o,O,0=endif,0=ENDIF,0=endelse,0=ENDELSE,0=endwhile,
\0=ENDWHILE,0=endfor,0=ENDFOR,0=endrep,0=ENDREP
setlocal indentkeys=o,O,0=endif,0=ENDIF,0=endelse,0=ENDELSE,0=endwhile,0=ENDWHILE,0=endfor,0=ENDFOR,0=endrep,0=ENDREP
setlocal indentexpr=GetIdlangIndent(v:lnum)

View File

@ -2,7 +2,7 @@
" Language: Java
" Previous Maintainer: Toby Allsopp <toby.allsopp@peace.com>
" Current Maintainer: Hong Xu <xuhdev@gmail.com>
" Last Change: 2012 Jan 20
" Last Change: 2012 May 18
" Version: 1.0
" License: Same as Vim.
" Copyright (c) 2012 Hong Xu
@ -29,6 +29,8 @@ let b:undo_indent = "set cin< cino< indentkeys< indentexpr<"
if exists("*GetJavaIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
function! SkipJavaBlanksAndComments(startline)
let lnum = a:startline
@ -139,4 +141,7 @@ function GetJavaIndent()
return theIndent
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
" vi: sw=2 et

View File

@ -1,7 +1,7 @@
" MetaPost indent file
" Language: MetaPost
" Maintainer: Eugene Minkovskii <emin@mccme.ru>
" Last Change: 2003 Nov 21
" Last Change: 2012 May 18
" Version: 0.1
" ==========================================================================
@ -56,6 +56,8 @@ setlocal indentkeys+=;,<:>,=if,=for,=def,=end,=else,=fi
if exists("*GetMetaPostIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
" Auxiliary Definitions: {{{1
function! MetaNextNonblankNoncomment(pos)
@ -203,4 +205,7 @@ function! GetMetaPostIndent()
endfunction
"
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:sw=2:fdm=marker

View File

@ -20,6 +20,8 @@ setlocal indentkeys=o,O,0=:
if exists("*GetOccamIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
"{{{ Indent definitions
" Define carriage return indent
@ -180,3 +182,6 @@ function GetOccamIndent()
endfunction
"}}}
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@ -48,6 +48,8 @@ setlocal indentexpr=GetSQLIndent()
if exists("*GetSQLIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
" List of all the statements that start a new block.
" These are typically words that start a line.
@ -382,4 +384,7 @@ function GetSQLIndent()
return s:ModuloIndent(ind)
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:sw=4:

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Vim script
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2011 Mar 22
" Last Change: 2012 May 18
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@ -16,6 +16,8 @@ setlocal indentkeys+==end,=else,=cat,=fina,=END,0\\
if exists("*GetVimIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
function GetVimIndent()
" Find a non-blank line above the current line.
@ -79,4 +81,7 @@ function GetVimIndent()
return ind
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:sw=2

View File

@ -15,6 +15,8 @@ setlocal nosmartindent
if exists("*GetXinetdIndent")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
function s:count_braces(lnum, count_open)
let n_open = 0
@ -48,3 +50,6 @@ function GetXinetdIndent()
return indent(pnum) + s:count_braces(pnum, 1) * &sw
\ - s:count_braces(v:lnum, 0) * &sw
endfunction
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@ -1,6 +1,6 @@
" Language: xml
" Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: 2009-05-26 00:17:25
" Last Change: 2012 May 18
" Notes: 1) does not indent pure non-xml code (e.g. embedded scripts)
" 2) will be confused by unbalanced tags in comments
" or CDATA sections.
@ -12,13 +12,13 @@ if exists("b:did_indent")
finish
endif
let b:did_indent = 1
let s:keepcpo= &cpo
set cpo&vim
" [-- local settings (must come before aborting the script) --]
setlocal indentexpr=XmlIndentGet(v:lnum,1)
setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,}
set cpo-=C
if !exists('b:xml_indent_open')
let b:xml_indent_open = '.\{-}<\a'
" pre tag, e.g. <address>
@ -93,4 +93,7 @@ fun! XmlIndentGet(lnum, use_syntax_check)
return ind
endfun
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:ts=8

View File

@ -1,7 +1,7 @@
" Vim indent file
" Language: Zimbu
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 May 17
" Last Change: 2011 Jun 19
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@ -16,13 +16,16 @@ setlocal indentkeys=0{,0},!^F,o,O,0=ELSE,0=ELSEIF,0=CASE,0=DEFAULT,0=FINALLY
" We impose recommended defaults: no Tabs, 'shiftwidth' = 2
setlocal sw=2 et
let b:undo_indent = "setl et< ai< indentexpr="
let b:undo_indent = "setl et< sw< ai< indentkeys< indentexpr="
" Only define the function once.
if exists("*GetZimbuIndent")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" Come here when loading the script the first time.
let s:maxoff = 50 " maximum number of lines to look backwards for ()
@ -121,3 +124,5 @@ func GetZimbuIndent(lnum)
return plindent
endfunc
let &cpo = s:cpo_save
unlet s:cpo_save