annotate runtime/ftplugin/xml.vim @ 19534:36ec10251b2b v8.2.0324

patch 8.2.0324: text property not updated correctly when inserting/deleting Commit: https://github.com/vim/vim/commit/12f20038714928bfecdeee31ed1f927324542034 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 26 22:06:00 2020 +0100 patch 8.2.0324: text property not updated correctly when inserting/deleting Problem: Text property not updated correctly when inserting/deleting. Solution: Use the right column when deleting. Make zero-width text properties respect start_incl and end_incl. (Axel Forsman, closes #5696, closes #5679)
author Bram Moolenaar <Bram@vim.org>
date Wed, 26 Feb 2020 22:15:04 +0100
parents bc1a8d21c811
children c968191a8557
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
15131
bc1a8d21c811 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13912
diff changeset
2 " Language: xml
bc1a8d21c811 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13912
diff changeset
3 " Maintainer: Christian Brabandt <cb@256bit.org>
bc1a8d21c811 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13912
diff changeset
4 " Last Changed: Dec 07th, 2018
bc1a8d21c811 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13912
diff changeset
5 " Repository: https://github.com/chrisbra/vim-xml-ftplugin
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
6 " Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
7 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 let s:save_cpo = &cpo
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
15 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 setlocal commentstring=<!--%s-->
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
18 " Remove the middlepart from the comments section, as this causes problems:
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
19 " https://groups.google.com/d/msg/vim_dev/x4GT-nqa0Kg/jvtRnEbtAnMJ
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
20 setlocal comments=s:<!--,e:-->
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 557
diff changeset
21
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 557
diff changeset
22 setlocal formatoptions-=t
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
23 setlocal formatoptions+=croql
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
24 setlocal formatexpr=xmlformat#Format()
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " XML: thanks to Johannes Zellner and Akbar Ibrahim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " - case sensitive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " - don't match empty tags <fred/>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " - match <!--, --> style comments (but not --, --)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " - match <!, > inlined dtd's. This is not perfect, as it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " gets confused for example by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " <!ENTITY gt ">">
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 if exists("loaded_matchit")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 let b:match_ignorecase=0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 let b:match_words =
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 \ '<:>,' .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 \ '<\@<=!\[CDATA\[:]]>,'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 \ '<\@<=!--:-->,'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 \ '<\@<=?\k\+:?>,'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
557
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
44 " For Omni completion, by Mikolaj Machowski.
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
45 if exists('&ofu')
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
46 setlocal ofu=xmlcomplete#CompleteTags
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
47 endif
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
48 command! -nargs=+ XMLns call xmlcomplete#CreateConnection(<f-args>)
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
49 command! -nargs=? XMLent call xmlcomplete#CreateEntConnection(<f-args>)
862863033fdd updated for version 7.0158
vimboss
parents: 7
diff changeset
50
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Change the :browse e filter to primarily show xml-related files.
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
52 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 let b:browsefilter="XML Files (*.xml)\t*.xml\n" .
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
54 \ "DTD Files (*.dtd)\t*.dtd\n" .
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
55 \ "XSD Files (*.xsd)\t*.xsd\n" .
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
56 \ "All Files (*.*)\t*.*\n"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " Undo the stuff we changed.
13912
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
60 let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions< formatexpr< " .
a9fdf01085a8 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 3410
diff changeset
61 \ " | unlet! b:match_ignorecase b:match_words b:browsefilter"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 let &cpo = s:save_cpo
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
65 unlet s:save_cpo