, 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, '', '', 'nWb')
\ && 0 < searchpair(js, '', '', 'nW')
" we're inside javascript
if getline(lnum) !~ js && getline(a:lnum) !~ ''
if restore_ic == 0
setlocal noic
endif
return GetJsIndent(a:lnum)
endif
endif
if getline(lnum) =~ '\c'
" line before the current line a:lnum contains
" a closing . --> search for line before
" starting to restore the indent.
let preline = prevnonblank(search('\c', 'bW') - 1)
if preline > 0
if restore_ic == 0
setlocal noic
endif
return indent(preline)
endif
endif
let ind = HtmlIndentSum(lnum, -1)
let ind = ind + HtmlIndentSum(a:lnum, 0)
if restore_ic == 0
setlocal noic
endif
return indent(lnum) + (&sw * ind)
endfun
let &cpo = s:cpo_save
unlet s:cpo_save
" [-- EOF /indent/html.vim --]