vim-pandoc / vim-pandoc-syntax

pandoc markdown syntax, to be installed alongside vim-pandoc
MIT License
425 stars 61 forks source link

Force spellchecking on after loading syntax file #375

Closed jez closed 2 years ago

jez commented 2 years ago

I noticed that I only had spell checking on in contained syntax regions, like headers and list elements.

I figure that if we're okay with unconditionally setting it on at the top level at the start of the syntax file, that we're okay with doing the same after loading an embedded language's syntax too.

Cross reference with where we set it at the start of the file here:

https://github.com/vim-pandoc/vim-pandoc-syntax/blob/5056e635ecf406e65d7d28651bab55600dd18741/syntax/pandoc.vim#L225

alerque commented 2 years ago

Question (I haven't tried to find a test case). If the embedded language turns spelling off for a reason (say a language that does not play nicely with it) does this allow our embedded blocks to respect that and then go on spell checking afterwards, or does it turn it on for the embedded block too?

It seems to me it probably does the latter, no? I'm probably okay with that because anything that truly doesn't play nice with spell checking should be marked in a NoSpell group anyway so the fault would really be with the embedded syntax.

jez commented 2 years ago

Yeah I also can’t think of a good test case. I’m more than happy for this change to be reverted if such a test case arises in the wild, and then find a better solution, but in the mean time I think it’s more common that this extension is essentially disabling almost all spell checking right now 😅

thanks for the fast review