lambdalisue / vim-manpager

Use Vim as a MANPAGER program
MIT License
62 stars 5 forks source link

Recent update of the `manpager.vim` in `$RUNTIME` files is causing an error on startup #21

Closed ilya-bobyr closed 2 years ago

ilya-bobyr commented 2 years ago

As of this update in the Vim repo

commit d592deb336523a5448779ee3d4bba80334cff1f7
Author: Bram Moolenaar <Bram@vim.org>
Date:   Fri Jun 17 15:42:40 2022 +0100

    Update runtime files

MANPAGER plugin in $VIMRUNTIME defines MANPAGER command without a consideration of whether it already exists or not. Effectively generating an error on every startup if vim-manpager plugin is also loaded:

$ vim
Error detected while processing /home/user/.local/share/vim/vim82/plugin/manpager.vim:
line    6:
E174: Command already exists: add ! to replace it: MANPAGER call s:ManPager()
Press ENTER or type command to continue

Possible fix: https://github.com/lambdalisue/vim-manpager/pull/20

lambdalisue commented 2 years ago

https://github.com/vim/vim/commit/d592deb336523a5448779ee3d4bba80334cff1f7

lambdalisue commented 2 years ago

This is an issue of Vim (because that update is backword incompatible) so please report it on Vim's issue.

ilya-bobyr commented 2 years ago

If both plugins redefine the same command, doesn't it create a problem, as the outcome depends on the load order? From the error, it seems that the plugin in $VIMRUNTIME is loaded second. I do not know if this is always the case.

As MANPAGER command is defined in a plugin that comes with Vim by default, it seems like it has priority. And plugins installed on top should deal with it, no? At least, since https://github.com/vim/vim/commit/d592deb336523a5448779ee3d4bba80334cff1f7 everyone will have the MANPAGER command defined, and anyone trying to load this plugin will see an error.

This is an issue of Vim (because that update is backword incompatible) so please report it on Vim's issue.

Not sure, I completely agree with you here.

I can try emailing the plugin maintainer of the stock MANPAGER plugin. Seems like that would be Maintainer: Enno Nagel <ennonagel+vim@gmail.com>. But I'm not sure what should I tell them? What do you think is the right resolution here? Ask them to skip defining the command if it is already defined?

lambdalisue commented 2 years ago

I don't know what is the right place to ask but Vim itself has a github repository. https://github.com/vim/vim/issues