Tuesday, January 22, 2013

Re: Limiting ftplugins to relevant buffers

On Tuesday, January 22, 2013 3:25:06 PM UTC-6, Charles Campbell wrote:
> neilhwatson@gmail.com wrote:
>
> > On Tuesday, 22 January 2013 15:30:23 UTC-5, Ben Fritz wrote:
>
> >> Where did you define the abbreviations? How did you edit the new buffer
>
> > (specific command sequence)?
>
> >
>
> > The abbreviations are on the ftplugin. New buffer: :e newfile.cf
>
> >
>
> > The plugin is here:
>
> > https://github.com/neilhwatson/vim_cf3/blob/dev/ftplugin/cf3.vim
>
> >
>
> In your code: once you have
>
>
>
> g:DisableCF3Ftplugin
>
>
>
> existing, the ftplugin won't be loaded again. Buffers are not filetypes; so you need to allow reloading of the ftplugin each time a buffer of the appropriate filetype is edited.
>

I saw that too, but the plugin file never sets g:DisableCF3Ftplugin, it looks like it is simply a way to disable the ftplugin from taking effect if the user has it installed but doesn't want it to load for some reason, on any buffer.

I think the problem is actually here:

if !exists('g:DisableCFE3KeywordAbbreviations')
let g:DisableCFE3KeywordAbbreviations=1
call EnableCFE3KeywordAbbreviations()
endif

That should be a buffer-local variable, not a global variable, otherwise the abbreviations will only load on the first buffer.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment