annotate runtime/ftplugin/rst.vim @ 30359:6391b3ca26b7 v9.0.0515

patch 9.0.0515: virtual text highlight starts too early when 'number' is set Commit: https://github.com/vim/vim/commit/2fdc9b541918237168ca05ac09eb4bb245e5c6c5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 20 15:59:22 2022 +0100 patch 9.0.0515: virtual text highlight starts too early when 'number' is set Problem: Virtual text highlight starts too early when 'number' is set. Solution: Set column offset when wrapping. (issue https://github.com/vim/vim/issues/11138)
author Bram Moolenaar <Bram@vim.org>
date Tue, 20 Sep 2022 17:00:05 +0200
parents 1908e92b02fd
children d46f974fd69e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
1 " reStructuredText filetype plugin file
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
2 " Language: reStructuredText documentation format
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
3 " Maintainer: Marshall Ward <marshall.ward@gmail.com>
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
4 " Original Maintainer: Nikolai Weibull <now@bitwi.se>
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
5 " Website: https://github.com/marshallward/vim-restructuredtext
19968
1908e92b02fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
6 " Latest Revision: 2020-03-31
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin")
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
9 finish
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
13 let s:cpo_save = &cpo
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
14 set cpo&vim
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
15
15334
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
16 "Disable folding
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
17 if !exists('g:rst_fold_enabled')
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
18 let g:rst_fold_enabled = 0
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
19 endif
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14421
diff changeset
20
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
21 let b:undo_ftplugin = "setl com< cms< et< fo<"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
23 setlocal comments=fb:.. commentstring=..\ %s expandtab
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
24 setlocal formatoptions+=tcroql
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
25
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
26 " reStructuredText standard recommends that tabs be expanded to 8 spaces
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
27 " The choice of 3-space indentation is to provide slightly better support for
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
28 " directives (..) and ordered lists (1.), although it can cause problems for
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
29 " many other cases.
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
30 "
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
31 " More sophisticated indentation rules should be revisted in the future.
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
32
15878
314694a2e74a Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
33 if exists("g:rst_style") && g:rst_style != 0
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
34 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
35 endif
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
36
19968
1908e92b02fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15878
diff changeset
37 if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
38 setlocal foldmethod=expr
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
39 setlocal foldexpr=RstFold#GetRstFold()
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
40 setlocal foldtext=RstFold#GetRstFoldText()
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
41 augroup RstFold
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
42 autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
43 augroup END
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
44 endif
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
45
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
46 let &cpo = s:cpo_save
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 839
diff changeset
47 unlet s:cpo_save