preservim / vim-markdown

Markdown Vim Mode
4.69k stars 524 forks source link

Disable code block syntax highlighting when syntax=OFF #580

Closed a5ob7r closed 2 years ago

a5ob7r commented 2 years ago

When &syntax's value is OFF, vim doesn't load syntax files for the file. However, this plugin loads code block syntax highlighting rules even if the value is OFF. This behavior is inconsistent for users to disable syntax highlighting locally. For example, this causes on a modeline such as <!-- vim: set syntax=OFF -->.

Use != to compare &syntax's value to use the same logic run on $VIMRUNTIME/syntax/synload.vim.