diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-12-21 14:41:23 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-12-21 14:41:23 +0100 |
commit | 87a26c5bf169bafbee837e2323f24cfb07e35250 (patch) | |
tree | 326eb21bb10c3d3633b83263d21c85c98f92a67e /indent/dtd.vim | |
parent | 918610d427503c5c7b380eae4a954bd8cb427db5 (diff) | |
download | vim-polyglot-87a26c5bf169bafbee837e2323f24cfb07e35250.tar.gz vim-polyglot-87a26c5bf169bafbee837e2323f24cfb07e35250.zip |
Update
Diffstat (limited to 'indent/dtd.vim')
-rw-r--r-- | indent/dtd.vim | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/indent/dtd.vim b/indent/dtd.vim index 7faa9483..41363410 100644 --- a/indent/dtd.vim +++ b/indent/dtd.vim @@ -3,14 +3,17 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'dtd', 'indent/dtd.vim') endif " Vim indent file -" Language: DTD (Document Type Definition for XML) -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2011-07-08 +" Language: DTD (Document Type Definition for XML) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 setlocal indentexpr=GetDTDIndent() setlocal indentkeys=!^F,o,O,> setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetDTDIndent") finish endif @@ -123,16 +126,16 @@ function GetDTDIndent() " Next comes the content model. If the token we’ve found isn’t a " parenthesis it must be either ANY, EMPTY or some random junk. Either " way, we’re done indenting this element, so set it to that of the first - " line so that the terminating “>” winds up having the same indention. + " line so that the terminating “>” winds up having the same indentation. if token != '(' return indent endif " Now go through the content model. We need to keep track of the nesting " of parentheses. As soon as we hit 0 we’re done. If that happens we must - " have a complete content model. Thus set indention to be the same as that + " have a complete content model. Thus set indentation to be the same as that " of the first line so that the terminating “>” winds up having the same - " indention. Otherwise, we’ll indent to the innermost parentheses not yet + " indentation. Otherwise, we’ll indent to the innermost parentheses not yet " matched. let [indent_of_innermost, end] = s:indent_to_innermost_parentheses(line, end) if indent_of_innermost != -1 |