From a2281bd121949f2215ee9257e28e2c0966f3f003 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 12 Nov 2017 16:38:09 +1300 Subject: Add guards for presence of b:undo_* var This variable is not set in older Vims (early 6.x), and I think it's worth guarding for. --- vim/after/ftplugin/text/spell.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'vim/after/ftplugin/text') diff --git a/vim/after/ftplugin/text/spell.vim b/vim/after/ftplugin/text/spell.vim index 107723e5..322090ca 100644 --- a/vim/after/ftplugin/text/spell.vim +++ b/vim/after/ftplugin/text/spell.vim @@ -4,12 +4,16 @@ if exists('b:did_ftplugin_text_spell') || &compatible finish endif let b:did_ftplugin_text_spell = 1 -let b:undo_ftplugin = b:undo_ftplugin - \ . '|unlet b:did_ftplugin_text_spell' +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|unlet b:did_ftplugin_text_spell' +endif " Spellcheck documents by default if has('syntax') setlocal spell - let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal spell<' + if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal spell<' + endif endif -- cgit v1.2.3