Skip to content

Commit 310082f

Browse files
Dragan Simicchrisbra
authored andcommitted
runtime(rst): Add support for rst_minlines
Following the approach used in other syntax definitions, add support for defining the "syntax sync minlines=..." values for rst files in the users' ~/.vimrc files, to allow the users to adjust that value in case syntax highlighting stops working for some of the files they edit. related: #18566 Signed-off-by: Dragan Simic <dsimic@manjaro.org> Signed-off-by: Marshall Ward <marshall.ward@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 0940465 commit 310082f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

runtime/doc/syntax.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*syntax.txt* For Vim version 9.1. Last change: 2025 Oct 12
1+
*syntax.txt* For Vim version 9.1. Last change: 2025 Oct 13
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3382,6 +3382,9 @@ To enable folding of sections: >
33823382
33833383
Note that folding can cause performance issues on some platforms.
33843384

3385+
The minimum line syntax sync is set to 50. To modify this number: >
3386+
let rst_minlines = 100
3387+
33853388
33863389
REXX *rexx.vim* *ft-rexx-syntax*
33873390

runtime/syntax/rst.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ for s:filetype in keys(g:rst_syntax_code_list)
246246
unlet! prior_isk
247247
endfor
248248

249+
249250
" Enable top level spell checking
250251
syntax spell toplevel
251252

252-
" TODO: Use better syncing.
253-
syn sync minlines=50 linebreaks=2
253+
exe "syn sync minlines=" . get(g:, 'rst_minlines', 50) . " linebreaks=2"
254254

255255
hi def link rstTodo Todo
256256
hi def link rstComment Comment

0 commit comments

Comments
 (0)