comparison runtime/indent/xml.vim @ 14421:2f7e67dd088c

Update runtime files. commit https://github.com/vim/vim/commit/91f84f6e11cd879d43d651c0903d85bff95f0716 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 29 15:07:52 2018 +0200 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Sun, 29 Jul 2018 15:15:06 +0200
parents 63b0b7b79b25
children 2b30a2b4bde2
comparison
equal deleted inserted replaced
14420:9114cf8a3e07 14421:2f7e67dd088c
1 " Language: xml 1 " Language: xml
2 " Maintainer: Johannes Zellner <johannes@zellner.org> 2 " Repository: https://github.com/chrisbra/vim-xml-ftplugin
3 " Last Change: 2017 Jun 13 3 " Maintainer: Christian Brabandt <cb@256bit.org>
4 " Previous Maintainer: Johannes Zellner <johannes@zellner.org>
5 " Last Change: 20180724 - Correctly indent xml comments https://github.com/vim/vim/issues/3200
4 " Notes: 1) does not indent pure non-xml code (e.g. embedded scripts) 6 " Notes: 1) does not indent pure non-xml code (e.g. embedded scripts)
5 " 2) will be confused by unbalanced tags in comments 7 " 2) will be confused by unbalanced tags in comments
6 " or CDATA sections. 8 " or CDATA sections.
7 " 2009-05-26 patch by Nikolai Weibull 9 " 2009-05-26 patch by Nikolai Weibull
8 " TODO: implement pre-like tags, see xml_indent_open / xml_indent_close 10 " TODO: implement pre-like tags, see xml_indent_open / xml_indent_close
53 let syn1 = synIDattr(synID(a:lnum, 1, 1), 'name') 55 let syn1 = synIDattr(synID(a:lnum, 1, 1), 'name')
54 let syn2 = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name') 56 let syn2 = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name')
55 if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml' 57 if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml'
56 " don't indent pure non-xml code 58 " don't indent pure non-xml code
57 return 0 59 return 0
58 elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment'
59 " indent comments specially
60 return -1
61 endif 60 endif
62 endif 61 endif
63 return 1 62 return 1
64 endfun 63 endfun
65 64