summaryrefslogtreecommitdiffstats
path: root/runtime/indent/html.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-05-05 17:54:07 +0000
committerBram Moolenaar <Bram@vim.org>2007-05-05 17:54:07 +0000
commit9964e468c0209f6b8286e0b08109817c845a3079 (patch)
tree3c53288cff0d4c2e32169d8eb4cd53cc343ad0bc /runtime/indent/html.vim
parentd5ab34bd5ecc748d5502f149c476968e5ec2b7c9 (diff)
updated for version 7.1a
Diffstat (limited to 'runtime/indent/html.vim')
-rw-r--r--runtime/indent/html.vim13
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index be34409552..6f016ad16c 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -1,6 +1,6 @@
" Description: html indenter
" Author: Johannes Zellner <johannes@zellner.org>
-" Last Change: Tue, 27 Apr 2004 10:28:39 CEST
+" Last Change: Mo, 05 Jun 2006 22:32:41 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
@@ -193,8 +193,17 @@ fun! HtmlIndentGet(lnum)
" [-- special handling for <javascript>: use cindent --]
let js = '<script.*type\s*=\s*.*java'
+
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ " by Tye Zdrojewski <zdro@yahoo.com>, 05 Jun 2006
+ " ZDR: This needs to be an AND (we are 'after the start of the pair' AND
+ " we are 'before the end of the pair'). Otherwise, indentation
+ " before the start of the script block will be affected; the end of
+ " the pair will still match if we are before the beginning of the
+ " pair.
+ "
if 0 < searchpair(js, '', '</script>', 'nWb')
- \ || 0 < searchpair(js, '', '</script>', 'nW')
+ \ && 0 < searchpair(js, '', '</script>', 'nW')
" we're inside javascript
if getline(lnum) !~ js && getline(a:lnum) != '</script>'
if restore_ic == 0