summaryrefslogtreecommitdiffstats
path: root/runtime/indent/html.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-31 15:40:56 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-31 15:40:56 +0000
commitc4573eb12dba6a062af28ee0b8938d1521934ce4 (patch)
tree45dead4c82bacf905972ddaddb20d6c15cbf7ca4 /runtime/indent/html.vim
parent424bcae1fb0f69e0aef5e0cf84fd771cf34a0fb7 (diff)
Update runtime files
Diffstat (limited to 'runtime/indent/html.vim')
-rw-r--r--runtime/indent/html.vim15
1 files changed, 12 insertions, 3 deletions
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index d4b91f6421..a3c32d6342 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -1,7 +1,7 @@
" Vim indent script for HTML
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change: 2021 Jun 13
+" Last Change: 2022 Jan 31
" Version: 1.0 "{{{
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -149,6 +149,15 @@ func HtmlIndent_CheckUserSettings()
let b:html_indent_line_limit = 200
endif
endif
+
+ if exists('b:html_indent_attribute')
+ let b:hi_attr_indent = b:html_indent_attribute
+ elseif exists('g:html_indent_attribute')
+ let b:hi_attr_indent = g:html_indent_attribute
+ else
+ let b:hi_attr_indent = 2
+ endif
+
endfunc "}}}
" Init Script Vars
@@ -946,11 +955,11 @@ func s:InsideTag(foundHtmlString)
let idx = match(text, '<' . s:tagname . '\s\+\zs\w')
endif
if idx == -1
- " after just "<tag" indent two levels more
+ " after just "<tag" indent two levels more by default
let idx = match(text, '<' . s:tagname . '$')
if idx >= 0
call cursor(lnum, idx + 1)
- return virtcol('.') - 1 + shiftwidth() * 2
+ return virtcol('.') - 1 + shiftwidth() * b:hi_attr_indent
endif
endif
if idx > 0