vim-pandoc/vim-pandoc-syntax

Spell check enabled but not working

medwatt opened this issue · 7 comments

I have spell check enabled for markdown documents. For some reason, with this plugin enabled, no spelling mistakes are detected. If I disable this plugin, the errors are detected.

I'm using Neovim 0.5 on Windows 10.

I see the same on Ubuntu 18, Vim 8

meck commented

Same issue but i notices spelling only stops working if i set a custom g:pandoc#syntax#codeblocks#embeds#langs without it spelling works fine.

I had the same issue. After troubleshooting I found that the syntax file for java located at $VIMRUNTIME/syntax/java.vim messes with the syntax spell option by setting: syntax spell default. This overwrites the spell check setting syntax spell toplevel set in syntax/pandoc.vim.

Removing 'java' from my g:pandoc#syntax#codeblocks#embeds#langs list in .vimrc solved the problem.

The current setting can be verified by typing :syntax spell in a buffer.
Setting the spell checking to toplevel also fixes the problem for the current buffer: :syntax spell toplevel

Great tip @NicolajNiels1. That might explain why I've never been able to replicate various reports like this (I don't have Java enabled as a possible embedded language) and why it keeps coming up. It might not be just Java either, perhaps there are other languages that trip people up.

I wonder if this is something we can mitigate by saving / restoring the setting after loaded embedded syntaxes. I think we do that already for some other settings.

meck commented

I checked and the my problems is traceable to haskell in g:pandoc#syntax#codeblocks#embeds#langs so its not only java

Thanks @meck, I think we're on to something. I'm pretty sure there is a way we can block this change.

I checked and the my problems is traceable to haskell in g:pandoc#syntax#codeblocks#embeds#langs so its not only java

Running grep -irn "syntax spell default" * when located in $VIMRUNTIME/syntax yields the following for me, confirming that it might not only be a problem with java:

groovy.vim:226:  syntax spell default  " added by Bram
java.vim:161:  syntax spell default
papp.vim:29:  syntax spell default  " added by Bram
spyce.vim:22:syntax spell default  " added by Bram

(Of course this is dependent on which vim distribution you are using. I am using macvim installed via homebrew. )