Skip to content

E121: Undefined variable: b:undo_ftplugin #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
willxy opened this issue Jul 30, 2016 · 1 comment
Closed

E121: Undefined variable: b:undo_ftplugin #579

willxy opened this issue Jul 30, 2016 · 1 comment

Comments

@willxy
Copy link

willxy commented Jul 30, 2016

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.

@bounceme
Copy link
Collaborator

#580 ,thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants