aboutsummaryrefslogtreecommitdiff
path: root/vim/after
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-08 21:05:11 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-08 21:05:11 +1200
commited11c7e686c9c856da25d73d236d9c3798b94bc2 (patch)
tree9219af4626c2785ffec9ce1a2a970aa1a61522dd /vim/after
parente3d1467a0c4bb10effd012e87f53a8c93a17ee60 (diff)
downloaddotfiles-ed11c7e686c9c856da25d73d236d9c3798b94bc2.tar.gz
dotfiles-ed11c7e686c9c856da25d73d236d9c3798b94bc2.zip
Test 'modifiable' for spellchecking text/markdown
Diffstat (limited to 'vim/after')
-rw-r--r--vim/after/ftplugin/markdown.vim2
-rw-r--r--vim/after/ftplugin/text.vim2
2 files changed, 2 insertions, 2 deletions
diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim
index 7ec37c64..69b794dd 100644
--- a/vim/after/ftplugin/markdown.vim
+++ b/vim/after/ftplugin/markdown.vim
@@ -13,7 +13,7 @@ let b:undo_ftplugin = b:undo_ftplugin
\ . '|unlet b:did_ftplugin_after'
" Spellcheck documents we're actually editing (not just viewing)
-if !&readonly
+if &modifiable && !&readonly
setlocal spell
let b:undo_ftplugin = b:undo_ftplugin
\ . '|setlocal spell<'
diff --git a/vim/after/ftplugin/text.vim b/vim/after/ftplugin/text.vim
index 06ca464a..83a9dcd8 100644
--- a/vim/after/ftplugin/text.vim
+++ b/vim/after/ftplugin/text.vim
@@ -13,7 +13,7 @@ let b:undo_ftplugin = b:undo_ftplugin
\ . '|unlet b:did_ftplugin_after'
" Spellcheck documents we're actually editing (not just viewing)
-if !&readonly
+if &modifiable && !&readonly
setlocal spell
let b:undo_ftplugin = b:undo_ftplugin
\ . '|setlocal spell<'