diff options
| author | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-07-18 19:37:18 +0000 |
| commit | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch) | |
| tree | 35fe43e01755e0f312650667004487a44d6b7941 /runtime/indent/html.vim | |
| parent | 96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff) | |
| parent | e8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff) | |
| download | rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2 rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip | |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'runtime/indent/html.vim')
| -rw-r--r-- | runtime/indent/html.vim | 15 |
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 |