From 34adfe6c10277c2c4f499a0bb113190120076900 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 Jun 2018 16:18:54 +1200 Subject: Correct logic of Markdown/text spell checking --- vim/after/ftplugin/text/spell.vim | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'vim/after/ftplugin/text') diff --git a/vim/after/ftplugin/text/spell.vim b/vim/after/ftplugin/text/spell.vim index 322090ca..73ca5486 100644 --- a/vim/after/ftplugin/text/spell.vim +++ b/vim/after/ftplugin/text/spell.vim @@ -1,8 +1,12 @@ " Only do this when not done yet for this buffer -" Also do nothing if 'compatible' enabled +" Also do nothing if 'compatible' enabled, or if the 'spell' feature isn't +" available if exists('b:did_ftplugin_text_spell') || &compatible finish endif +if !has('spell') + finish +endif let b:did_ftplugin_text_spell = 1 if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin @@ -10,10 +14,8 @@ if exists('b:undo_ftplugin') endif " Spellcheck documents by default -if has('syntax') - setlocal spell - if exists('b:undo_ftplugin') - let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal spell<' - endif +setlocal spell +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal spell<' endif -- cgit v1.2.3