commit d6a9679b46043df01f5798232b28afac24ed5746
parent 263d0f86b4604bd5ca325cfd1004f0f06a872074
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 14 Oct 2025 10:44:26 +0800
vim-patch:a70f346: runtime(rst): Enable spell checking for more syntax constructs
Enable spell checking for more recognised constructs:
* comments
* footnotes
* citations
* directives
* inline markup (*text*, **text**, ...)
related: vim/vim#18566
https://github.com/vim/vim/commit/a70f3467069eaf40a037ad74aa4f1ccb44565271
Co-authored-by: Kirk Roemer <91125534+kirk-roemer@users.noreply.github.com>
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
@@ -78,7 +78,7 @@ execute 'syn region rstCitation contained matchgroup=rstDirective' .
execute 'syn region rstFootnote contained matchgroup=rstDirective' .
\ ' start=+\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]\_s+' .
\ ' skip=+^$+' .
- \ ' end=+^\s\@!+ contains=@rstCruft,@NoSpell'
+ \ ' end=+^\s\@!+ contains=@Spell,@rstCruft'
syn region rstHyperlinkTarget contained matchgroup=rstDirective
\ start='_\%(_\|[^:\\]*\%(\\.[^:\\]*\)*\):\_s' skip=+^$+ end=+^\s\@!+
@@ -92,7 +92,7 @@ syn region rstHyperlinkTarget matchgroup=rstDirective
execute 'syn region rstExDirective contained matchgroup=rstDirective' .
\ ' start=+' . s:ReferenceName . '::\_s+' .
\ ' skip=+^$+' .
- \ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock,rstExplicitMarkup'
+ \ ' end=+^\s\@!+ contains=@Spell,@rstCruft,rstLiteralBlock,rstExplicitMarkup'
execute 'syn match rstSubstitutionDefinition contained' .
\ ' /|.*|\_s\+/ nextgroup=@rstDirectives'
@@ -106,10 +106,10 @@ function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_righ
endif
if a:start != '``'
- let rst_contains=' contains=rstEscape' . a:name
+ let rst_contains=' contains=@Spell,rstEscape' . a:name
execute 'syn match rstEscape'.a:name.' +\\\\\|\\'.first.'+'.' contained'
else
- let rst_contains=''
+ let rst_contains=' contains=@Spell'
endif
execute 'syn region rst' . a:name .