Mercurial > vim
comparison runtime/indent/xml.vim @ 3526:dd6c2497c997
Fix more 'cpo' issues in runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 18 May 2012 21:49:28 +0200 |
parents | 7bc41231fbc7 |
children | 9910cbff5f16 |
comparison
equal
deleted
inserted
replaced
3525:b1f40dd6f844 | 3526:dd6c2497c997 |
---|---|
1 " Language: xml | 1 " Language: xml |
2 " Maintainer: Johannes Zellner <johannes@zellner.org> | 2 " Maintainer: Johannes Zellner <johannes@zellner.org> |
3 " Last Change: 2009-05-26 00:17:25 | 3 " Last Change: 2012 May 18 |
4 " Notes: 1) does not indent pure non-xml code (e.g. embedded scripts) | 4 " Notes: 1) does not indent pure non-xml code (e.g. embedded scripts) |
5 " 2) will be confused by unbalanced tags in comments | 5 " 2) will be confused by unbalanced tags in comments |
6 " or CDATA sections. | 6 " or CDATA sections. |
7 " 2009-05-26 patch by Nikolai Weibull | 7 " 2009-05-26 patch by Nikolai Weibull |
8 " TODO: implement pre-like tags, see xml_indent_open / xml_indent_close | 8 " TODO: implement pre-like tags, see xml_indent_open / xml_indent_close |
10 " Only load this indent file when no other was loaded. | 10 " Only load this indent file when no other was loaded. |
11 if exists("b:did_indent") | 11 if exists("b:did_indent") |
12 finish | 12 finish |
13 endif | 13 endif |
14 let b:did_indent = 1 | 14 let b:did_indent = 1 |
15 let s:keepcpo= &cpo | |
16 set cpo&vim | |
15 | 17 |
16 " [-- local settings (must come before aborting the script) --] | 18 " [-- local settings (must come before aborting the script) --] |
17 setlocal indentexpr=XmlIndentGet(v:lnum,1) | 19 setlocal indentexpr=XmlIndentGet(v:lnum,1) |
18 setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,} | 20 setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,} |
19 | |
20 set cpo-=C | |
21 | 21 |
22 if !exists('b:xml_indent_open') | 22 if !exists('b:xml_indent_open') |
23 let b:xml_indent_open = '.\{-}<\a' | 23 let b:xml_indent_open = '.\{-}<\a' |
24 " pre tag, e.g. <address> | 24 " pre tag, e.g. <address> |
25 " let b:xml_indent_open = '.\{-}<[/]\@!\(address\)\@!' | 25 " let b:xml_indent_open = '.\{-}<[/]\@!\(address\)\@!' |
91 let ind = <SID>XmlIndentSum(a:lnum, 0, ind) | 91 let ind = <SID>XmlIndentSum(a:lnum, 0, ind) |
92 | 92 |
93 return ind | 93 return ind |
94 endfun | 94 endfun |
95 | 95 |
96 let &cpo = s:keepcpo | |
97 unlet s:keepcpo | |
98 | |
96 " vim:ts=8 | 99 " vim:ts=8 |