Skip to content
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

Vaffle and projectionist interfere with one another #56

Open
WhoIsSethDaniel opened this issue Oct 1, 2020 · 6 comments
Open

Vaffle and projectionist interfere with one another #56

WhoIsSethDaniel opened this issue Oct 1, 2020 · 6 comments

Comments

@WhoIsSethDaniel
Copy link
Contributor

No description provided.

@WhoIsSethDaniel
Copy link
Contributor Author

I use the projectionist vim plugin (https://github.com/tpope/vim-projectionist). When I attempt to use :Vaffle an exception occurs:

Error detected while processing function vaffle#init[45]..function vaffle#init[39]..vaffle#buffer#init[3]..BufFilePost Autocommands for "*"..function ProjectionistDetect[14]..<SNR>50_load[2]..script /home/seth/.vim/pack/git-plugins
/opt/vaffle.vim/autoload/vaffle.vim:
line  123:
E127: Cannot redefine function vaffle#init: It is in use

When in autoload/vaffle/buffer.vim the 'file' command is used to rename the buffer this triggers an autocommand in projectionist that attempts to detect the type of the buffer. Beyond that I'm unclear on exactly what is happening. I will continue to look at it but I don't know that I'll resolve this issue on my own.

To replicate simply install projectionist and attempt to run Vaffle.

@WhoIsSethDaniel
Copy link
Contributor Author

The most radical change that will work is to use 'noautocmd' for the line that runs 'file'. This seems like using a nuclear bomb to kill a fly.

autoload/vaffle/buffer.vim:

 execute printf('silent noautocmd keepalt file %s',
        \ s:generate_unique_bufname(a:filer.dir))

@WhoIsSethDaniel
Copy link
Contributor Author

I can

let g:projectionist_ignore_vaffle = 1

in my config and this will ignore anything with the namespace 'vaffle'. This appears to be undocumented but is in the projectionist code. It also keeps projectionist and vaffle from interfering with one another.

@WhoIsSethDaniel
Copy link
Contributor Author

The actual cause of the problem appears to be projectionist attempting to execute "runtime! autoload/vaffle.vim" from within s:load() in the plugin/projectionist.vim code. I haven't wrapped my head around all that projectionist is doing. For now I think I'm going to just do the thing I mention in the above comment.

@ajitid
Copy link

ajitid commented Apr 27, 2021

@WhoIsSethDaniel does using let g:projectionist_ignore_vaffle = 1 causes any issue or disables any feature? I too am facing the same issue and applied the fix you suggested.

@WhoIsSethDaniel
Copy link
Contributor Author

@WhoIsSethDaniel does using let g:projectionist_ignore_vaffle = 1 causes any issue or disables any feature? I too am facing the same issue and applied the fix you suggested.

I've been using it without issue for months. Doesn't remove any features as far as I can tell.

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