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

timing problem during autoload? #1

Closed
rkueke opened this issue Nov 20, 2018 · 4 comments
Closed

timing problem during autoload? #1

rkueke opened this issue Nov 20, 2018 · 4 comments

Comments

@rkueke
Copy link

rkueke commented Nov 20, 2018

Dear Charles
Excellent idea to set vim variables from a file easily by your plugin, particularly for configuring ale for c/c++.

My problem with vim8 and tpope/vim-plug:
Starting vim with your plugin installed, inside .vimrc a simple function call
e.g. "echom Filify#process("filename")" causes some error messages:

Error detected while processing /home/rkueke/.vim/plugged/VimFilify/autoload/Filify.vim:
line 49:
E127: Cannot redefine function Filify#process: It is in use
line 79:
E127: Cannot redefine function Filify#process_main: It is in use
Error detected while processing function Filify#process[33]..Filify#process_main:
line 14:
E117: Unknown function: Filify#parent
E15: Invalid expression: Filify#parent(a:dir)
...

  1. After continuing with vim the same function call on the vim command line works fine.
  2. Issuing a :source % runs the complete .vimrc without errors. All variable settings via VimFilify work correctly.

Maybe a timing problem with autoload? How can I correct this behavior?
Kind regards, Reimund, 2018-11-20

@CharlesGueunet
Copy link
Owner

Dear Reimund,

Thanks for your feedback, i will investigate this as soon as I have the time (it is complicated for now).
If you want to use this plugin for Ale, I would suggest to take a look at this file: ale.vim which basically setup Ale config (it use cmake and a script also on the same repo).

I will let this Issue open until I either fix the problem or complete the doc !

Best regards,
Charles

@rkueke
Copy link
Author

rkueke commented Nov 20, 2018

Dear Charles
Thanks for the quick response. CORRECTION: The plugin manager I use is: 'junegunn/vim-plug'.
I keep you informed in case ale.vim shows a similar behavior.

Kind regards, Reimund, 2018-11-20

@rkueke
Copy link
Author

rkueke commented Nov 20, 2018

Dear Charles

I expected the impossible from your plugin!
A plain assignment of a value to a variable in .vimrc by a plugin function cannot work because plugins are loaded after .vimrc is completely read.

The only way to do it the right way is encapsulating the VimFilify call in an augroup as you did it in ale.vim. Thanks for your support. I think we can close this issue.

Kind regards, Reimund, 2018-11-20

@CharlesGueunet
Copy link
Owner

Good, I will try to improve the doc on this point !

best regards,
Charles

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