comparison runtime/indent/html.vim @ 10734:523cd59d6db0

Update runtime files. commit https://github.com/vim/vim/commit/690afe1fef87e7eef6fb7343a926617d5f7315fa Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 28 18:34:47 2017 +0100 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Sat, 28 Jan 2017 18:45:05 +0100
parents 8a1481e59d64
children 63b0b7b79b25
comparison
equal deleted inserted replaced
10733:7a5df0f9635f 10734:523cd59d6db0
1 " Vim indent script for HTML 1 " Vim indent script for HTML
2 " Header: "{{{ 2 " Header: "{{{
3 " Maintainer: Bram Moolenaar 3 " Maintainer: Bram Moolenaar
4 " Original Author: Andy Wokula <anwoku@yahoo.de> 4 " Original Author: Andy Wokula <anwoku@yahoo.de>
5 " Last Change: 2016 Mar 30 5 " Last Change: 2017 Jan 17
6 " Version: 1.0 6 " Version: 1.0
7 " Description: HTML indent script with cached state for faster indenting on a 7 " Description: HTML indent script with cached state for faster indenting on a
8 " range of lines. 8 " range of lines.
9 " Supports template systems through hooks. 9 " Supports template systems through hooks.
10 " Supports Closure stylesheets. 10 " Supports Closure stylesheets.
23 23
24 " Init Folklore, check user settings (2nd time ++) 24 " Init Folklore, check user settings (2nd time ++)
25 if exists("b:did_indent") "{{{ 25 if exists("b:did_indent") "{{{
26 finish 26 finish
27 endif 27 endif
28
29 " Load the Javascript indent script first, it defines GetJavascriptIndent().
30 " Undo the rest.
31 " Load base python indent.
32 if !exists('*GetJavascriptIndent')
33 runtime! indent/javascript.vim
34 endif
28 let b:did_indent = 1 35 let b:did_indent = 1
29 36
30 setlocal indentexpr=HtmlIndent() 37 setlocal indentexpr=HtmlIndent()
31 setlocal indentkeys=o,O,<Return>,<>>,{,},!^F 38 setlocal indentkeys=o,O,<Return>,<>>,{,},!^F
32 39
33 " "j1" is included to make cindent() work better with Javascript.
34 setlocal cino=j1
35 " "J1" should be included, but it doen't work properly before 7.4.355.
36 if has("patch-7.4.355")
37 setlocal cino+=J1
38 endif
39 " Before patch 7.4.355 indenting after "(function() {" does not work well, add
40 " )2 to limit paren search.
41 if !has("patch-7.4.355")
42 setlocal cino+=)2
43 endif
44
45 " Needed for % to work when finding start/end of a tag. 40 " Needed for % to work when finding start/end of a tag.
46 setlocal matchpairs+=<:> 41 setlocal matchpairs+=<:>
47 42
48 let b:undo_indent = "setlocal inde< indk< cino<" 43 let b:undo_indent = "setlocal inde< indk<"
49 44
50 " b:hi_indent keeps state to speed up indenting consecutive lines. 45 " b:hi_indent keeps state to speed up indenting consecutive lines.
51 let b:hi_indent = {"lnum": -1} 46 let b:hi_indent = {"lnum": -1}
52 47
53 """""" Code below this is loaded only once. """"" 48 """""" Code below this is loaded only once. """""
594 if lnum == b:hi_indent.blocklnr 589 if lnum == b:hi_indent.blocklnr
595 " indent for the first line after <script> 590 " indent for the first line after <script>
596 return eval(b:hi_js1indent) 591 return eval(b:hi_js1indent)
597 endif 592 endif
598 if b:hi_indent.scripttype == "javascript" 593 if b:hi_indent.scripttype == "javascript"
599 return cindent(v:lnum) 594 return GetJavascriptIndent()
600 else 595 else
601 return -1 596 return -1
602 endif 597 endif
603 endfunc "}}} 598 endfunc "}}}
604 599