aboutsummaryrefslogtreecommitdiff
path: root/vim/after
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-03 16:18:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-03 16:20:22 +1200
commit34adfe6c10277c2c4f499a0bb113190120076900 (patch)
treeea5d17827a516224892dd1e02da214b833fdb1f6 /vim/after
parentVim ftplugin: hold autoformat in *.md code blocks (diff)
downloaddotfiles-34adfe6c10277c2c4f499a0bb113190120076900.tar.gz
dotfiles-34adfe6c10277c2c4f499a0bb113190120076900.zip
Correct logic of Markdown/text spell checking
Diffstat (limited to 'vim/after')
-rw-r--r--vim/after/ftplugin/markdown/spell.vim16
-rw-r--r--vim/after/ftplugin/text/spell.vim16
2 files changed, 18 insertions, 14 deletions
diff --git a/vim/after/ftplugin/markdown/spell.vim b/vim/after/ftplugin/markdown/spell.vim
index bb344374..05fc7c00 100644
--- a/vim/after/ftplugin/markdown/spell.vim
+++ b/vim/after/ftplugin/markdown/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_markdown_spell') || &compatible
finish
endif
+if !has('spell')
+ finish
+endif
let b:did_ftplugin_markdown_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
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