summaryrefslogtreecommitdiffstats
path: root/runtime/indent/html.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-28 18:34:47 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-28 18:34:47 +0100
commit690afe1fef87e7eef6fb7343a926617d5f7315fa (patch)
tree4c999e25b68b0bb5310ea7b53888f97f2a77f95a /runtime/indent/html.vim
parent3a29abcb6154d9f55ca8abd6d97e5822b97ac4b3 (diff)
Update runtime files.
Diffstat (limited to 'runtime/indent/html.vim')
-rw-r--r--runtime/indent/html.vim25
1 files changed, 10 insertions, 15 deletions
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index 13adaae54c..57ba53ecd4 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change: 2016 Mar 30
+" Last Change: 2017 Jan 17
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -25,27 +25,22 @@
if exists("b:did_indent") "{{{
finish
endif
+
+" Load the Javascript indent script first, it defines GetJavascriptIndent().
+" Undo the rest.
+" Load base python indent.
+if !exists('*GetJavascriptIndent')
+ runtime! indent/javascript.vim
+endif
let b:did_indent = 1
setlocal indentexpr=HtmlIndent()
setlocal indentkeys=o,O,<Return>,<>>,{,},!^F
-" "j1" is included to make cindent() work better with Javascript.
-setlocal cino=j1
-" "J1" should be included, but it doen't work properly before 7.4.355.
-if has("patch-7.4.355")
- setlocal cino+=J1
-endif
-" Before patch 7.4.355 indenting after "(function() {" does not work well, add
-" )2 to limit paren search.
-if !has("patch-7.4.355")
- setlocal cino+=)2
-endif
-
" Needed for % to work when finding start/end of a tag.
setlocal matchpairs+=<:>
-let b:undo_indent = "setlocal inde< indk< cino<"
+let b:undo_indent = "setlocal inde< indk<"
" b:hi_indent keeps state to speed up indenting consecutive lines.
let b:hi_indent = {"lnum": -1}
@@ -596,7 +591,7 @@ func! s:Alien3()
return eval(b:hi_js1indent)
endif
if b:hi_indent.scripttype == "javascript"
- return cindent(v:lnum)
+ return GetJavascriptIndent()
else
return -1
endif