diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-05-05 21:15:17 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-05-05 21:15:17 +0000 |
commit | 91170f8ae70cb9a2c15a5d89182f317c18aa0de7 (patch) | |
tree | 1633e86e6a00760931319093cec0ea7fc3709893 /runtime/indent | |
parent | f3a678875fd88038b18b83311075d1250d9d7ca5 (diff) | |
download | vim-git-91170f8ae70cb9a2c15a5d89182f317c18aa0de7.tar.gz |
updated for version 7.0g04
Diffstat (limited to 'runtime/indent')
-rw-r--r-- | runtime/indent/html.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index cfea7d85e..be3440955 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -1,6 +1,7 @@ " Description: html indenter " Author: Johannes Zellner <johannes@zellner.org> " Last Change: Tue, 27 Apr 2004 10:28:39 CEST +" Restoring 'cpo' and 'ic' added by Bram 2006 May 5 " Globals: g:html_indent_tags -- indenting tags " g:html_indent_strict -- inhibit 'O O' elements " g:html_indent_strict_table -- inhibit 'O -' elements @@ -116,6 +117,7 @@ endif delfun <SID>HtmlIndentPush +let s:cpo_save = &cpo set cpo-=C " [-- count indent-increasing tags of line a:lnum --] @@ -183,6 +185,9 @@ fun! HtmlIndentGet(lnum) \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb') \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW') " we're in a line with </pre> or inside <pre> ... </pre> + if restore_ic == 0 + setlocal noic + endif return -1 endif @@ -192,6 +197,9 @@ fun! HtmlIndentGet(lnum) \ || 0 < searchpair(js, '', '</script>', 'nW') " we're inside javascript if getline(lnum) !~ js && getline(a:lnum) != '</script>' + if restore_ic == 0 + setlocal noic + endif return cindent(a:lnum) endif endif @@ -202,6 +210,9 @@ fun! HtmlIndentGet(lnum) " starting <pre> to restore the indent. let preline = prevnonblank(search('\c<pre>', 'bW') - 1) if preline > 0 + if restore_ic == 0 + setlocal noic + endif return indent(preline) endif endif @@ -216,4 +227,7 @@ fun! HtmlIndentGet(lnum) return indent(lnum) + (&sw * ind) endfun +let &cpo = s:cpo_save +unlet s:cpo_save + " [-- EOF <runtime>/indent/html.vim --] |