Closed
Description
After e6a4f2f, where it does:
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
I'm getting:
Error detected while processing /home/will/.vim/plugged/vim-javascript/after/
ftplugin/javascript.vim:
line 11:
E121: Undefined variable: b:undo_ftplugin
E121: Undefined variable: b:undo_ftplugin
E121: Undefined variable: b:undo_ftplugin
Searching around, it looks some solutions (jalvesaq/Nvim-R#9) can be:
if exists("b:undo_ftplugin")
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
Or to avoid code duplication, maybe just initializing before appending to it:
if !exists("b:undo_ftplugin") | let b:undo_ftplugin = '#!' | endif
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
The '#!'
was the best I could find as a no-op (second best was 'silent echo'
). It looked like an empty string (''
) doesn't work as a noop; that produces error E749: empty buffer
.
Metadata
Metadata
Assignees
Labels
No labels