comparison runtime/indent/xml.vim @ 18790:8dde7ced3344

Update a few runtime files Commit: https://github.com/vim/vim/commit/4ceaa3a6e0b8cb2994c303041aedcbb60527cd61 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 3 22:49:09 2019 +0100 Update a few runtime files
author Bram Moolenaar <Bram@vim.org>
date Tue, 03 Dec 2019 23:00:06 +0100
parents 6d11fc4aa683
children 29c5f168c6fd
comparison
equal deleted inserted replaced
18789:bea2e4dfc6d7 18790:8dde7ced3344
1 " Language: XML 1 " Language: XML
2 " Maintainer: Christian Brabandt <cb@256bit.org> 2 " Maintainer: Christian Brabandt <cb@256bit.org>
3 " Repository: https://github.com/chrisbra/vim-xml-ftplugin 3 " Repository: https://github.com/chrisbra/vim-xml-ftplugin
4 " Previous Maintainer: Johannes Zellner <johannes@zellner.org> 4 " Previous Maintainer: Johannes Zellner <johannes@zellner.org>
5 " Last Changed: 2019 Oct 24 5 " Last Changed: 2019 Dec 02
6 " Last Change: 6 " Last Change:
7 " 20191202 - Handle docbk filetype
7 " 20190726 - Correctly handle non-tagged data 8 " 20190726 - Correctly handle non-tagged data
8 " 20190204 - correctly handle wrap tags 9 " 20190204 - correctly handle wrap tags
9 " https://github.com/chrisbra/vim-xml-ftplugin/issues/5 10 " https://github.com/chrisbra/vim-xml-ftplugin/issues/5
10 " 20190128 - Make sure to find previous tag 11 " 20190128 - Make sure to find previous tag
11 " https://github.com/chrisbra/vim-xml-ftplugin/issues/4 12 " https://github.com/chrisbra/vim-xml-ftplugin/issues/4
132 let syn_name_start = synIDattr(synID(a:lnum, match(curline, '\S') + 1, 1), 'name') 133 let syn_name_start = synIDattr(synID(a:lnum, match(curline, '\S') + 1, 1), 'name')
133 endif 134 endif
134 135
135 if syn_name_end =~ 'Comment' && syn_name_start =~ 'Comment' 136 if syn_name_end =~ 'Comment' && syn_name_start =~ 'Comment'
136 return <SID>XmlIndentComment(a:lnum) 137 return <SID>XmlIndentComment(a:lnum)
137 elseif empty(syn_name_start) && empty(syn_name_end) 138 elseif empty(syn_name_start) && empty(syn_name_end) && a:use_syntax_check
138 " non-xml tag content: use indent from 'autoindent' 139 " non-xml tag content: use indent from 'autoindent'
139 return pind + shiftwidth() 140 return pind + shiftwidth()
140 endif 141 endif
141 142
142 " Get indent from previous tag line 143 " Get indent from previous tag line
146 return ind 147 return ind
147 endfun 148 endfun
148 149
149 func! <SID>IsXMLContinuation(line) 150 func! <SID>IsXMLContinuation(line)
150 " Checks, whether or not the line matches a start-of-tag 151 " Checks, whether or not the line matches a start-of-tag
151 return a:line !~ '^\s*<' 152 return a:line !~ '^\s*<' && &ft is# 'xml'
152 endfunc 153 endfunc
153 154
154 func! <SID>HasNoTagEnd(line) 155 func! <SID>HasNoTagEnd(line)
155 " Checks whether or not the line matches '>' (so finishes a tag) 156 " Checks whether or not the line matches '>' (so finishes a tag)
156 return a:line !~ '>\s*$' 157 return a:line !~ '>\s*$'