diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-10 22:00:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-10 22:00:53 +0200 |
commit | 7ff78465f7057a672a6de0d75d56286da253501b (patch) | |
tree | e35e18d5462fab10968567970cb14cfe92a82bb7 /runtime/indent | |
parent | a7eedf317a806fceec1ddd8f9bebed6e00be0ed2 (diff) | |
download | vim-git-7ff78465f7057a672a6de0d75d56286da253501b.tar.gz |
Update runtime files
Diffstat (limited to 'runtime/indent')
-rw-r--r-- | runtime/indent/Makefile | 2 | ||||
-rw-r--r-- | runtime/indent/html.vim | 7 | ||||
-rw-r--r-- | runtime/indent/testdir/html.in | 30 | ||||
-rw-r--r-- | runtime/indent/testdir/html.ok | 88 |
4 files changed, 93 insertions, 34 deletions
diff --git a/runtime/indent/Makefile b/runtime/indent/Makefile index d19260552..f6c44736d 100644 --- a/runtime/indent/Makefile +++ b/runtime/indent/Makefile @@ -10,5 +10,5 @@ test: VIMRUNTIME=$(VIMRUNTIME) $(VIM) --clean --not-a-term -u testdir/runtest.vim -clean: +clean testclean: rm -f testdir/*.fail testdir/*.out diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index c99eb288b..fdd743e89 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -1,9 +1,8 @@ " Vim indent script for HTML -" Header: "{{{ " Maintainer: Bram Moolenaar " Original Author: Andy Wokula <anwoku@yahoo.de> -" Last Change: 2020 Jun 18 -" Version: 1.0 +" Last Change: 2020 Jul 06 +" Version: 1.0 "{{{ " Description: HTML indent script with cached state for faster indenting on a " range of lines. " Supports template systems through hooks. @@ -587,7 +586,7 @@ func! s:Alien3() return eval(b:hi_js1indent) endif if b:hi_indent.scripttype == "javascript" - return GetJavascriptIndent() + return eval(b:hi_js1indent) + GetJavascriptIndent() else return -1 endif diff --git a/runtime/indent/testdir/html.in b/runtime/indent/testdir/html.in index 80ce0cdf8..1acf8c040 100644 --- a/runtime/indent/testdir/html.in +++ b/runtime/indent/testdir/html.in @@ -2,6 +2,16 @@ " START_INDENT +<html> + <body> +<style> +div#d1 { color: red; } +div#d2 { color: green; } +</style> + <script> + var v1 = "v1"; +var v2 = "v2"; + </script> <div> <div> text @@ -32,5 +42,25 @@ dt text </dt> </dl> + </body> +</html> " END_INDENT + +% START_INDENT +% INDENT_EXE let g:html_indent_style1 = "inc" +% INDENT_EXE let g:html_indent_script1 = "zero" +% INDENT_EXE call HtmlIndent_CheckUserSettings() +<html> + <body> +<style> +div#d1 { color: red; } +div#d2 { color: green; } +</style> + <script> + var v1 = "v1"; +var v2 = "v2"; + </script> +</body> +</html> +% END_INDENT diff --git a/runtime/indent/testdir/html.ok b/runtime/indent/testdir/html.ok index a96141fb3..ba2fd3fc7 100644 --- a/runtime/indent/testdir/html.ok +++ b/runtime/indent/testdir/html.ok @@ -2,35 +2,65 @@ " START_INDENT -<div> - <div> - text - </div> -</div> - -<div - class="foo bar"> - text -</div> - -<div class="foo bar" - data="something"> - text -</div> - -<div class="foo - bar"> - text -</div> - -<dl> - <dd> - dd text - </dd> - <dt> - dt text - </dt> -</dl> +<html> + <body> + <style> +div#d1 { color: red; } +div#d2 { color: green; } + </style> + <script> + var v1 = "v1"; + var v2 = "v2"; + </script> + <div> + <div> + text + </div> + </div> + <div + class="foo bar"> + text + </div> + + <div class="foo bar" + data="something"> + text + </div> + + <div class="foo + bar"> + text + </div> + + <dl> + <dd> + dd text + </dd> + <dt> + dt text + </dt> + </dl> + + </body> +</html> " END_INDENT + +% START_INDENT +% INDENT_EXE let g:html_indent_style1 = "inc" +% INDENT_EXE let g:html_indent_script1 = "zero" +% INDENT_EXE call HtmlIndent_CheckUserSettings() +<html> + <body> + <style> + div#d1 { color: red; } + div#d2 { color: green; } + </style> + <script> +var v1 = "v1"; +var v2 = "v2"; + </script> + </body> +</html> +% END_INDENT |