-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Support for lewis6991/gitsigns.nvim broken #306
Comments
I can confirm the breaking on the Here's a reproducible configurations for neovim plugin_home = vim.fn.stdpath('cache') .. '/nord.tmp'
vim_plug_url = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
vim_plug = plugin_home .. '/plug.vim'
if vim.fn.filereadable(vim_plug) == 0 then
vim.cmd(
'silent !curl -fLo ' .. vim_plug .. ' --create-dirs ' .. vim_plug_url
)
end
vim.opt.runtimepath:append(plugin_home)
vim.fn['plug#begin'](plugin_home)
vim.fn['plug#']('mhinz/vim-signify')
vim.fn['plug#']('arcticicestudio/nord-vim')
vim.fn['plug#end']()
if vim.fn.isdirectory(plugin_home .. '/nord-vim') == 0 then
vim.cmd('PlugInstall --sync | q')
end
print('before loaded_signify: ', vim.g.loaded_signify)
vim.cmd('colorscheme nord')
print('after loaded_signify: ', vim.g.loaded_signify) Save it as So this block of code is not loaded when setting the color scheme |
That's exactly the issue I have!
|
Hi @richardstrnad 👋, thanks for your contribution 👍 Basically, the PR can't have broken the support because there has never been explicit support for the I'd say this is not a problem of the PR but only just a side effect. We could add dedicated support for the @spywhere thanks for the reproduction snippet 👍🏼 After playing around with multiple plugins that are explicitly supported by Nord, loaded with different Vim(8) and Neovim plugin managers, I noticed various problems with the way how plugins and loaded, especially their order and when the code is applied to global namespaces to be available to other scripts. I've often had reports regarding this issue and up to today this is still the most annoying reason why users having problems when it comes to loading Nord plugin options. Anyway, I decided to revert the changes from PR #294 because I haven't thought about the fact that the plugin loading order could be random and the Nord plugin might be loaded before the ones that are supported, but the highlighting groups will be missing because of this. The advantage of having faster loading times which are only in the nanosecond range is way to The advantage that it is only minimally faster (we're talking about nanoseconds here) is too small compared to the fact that the actual functionally of the plugin could no longer work properly. |
Instead of simply either conditionally or un-conditionally loaded plugin related highlights. I think we could introduce a new option to let the user choose if they want to change how it behaves. In general, more features always good to have but more importantly is how to get those features roll out. And one easy way to make it happy for all is to opt-in into a new feature through configuration options. Regardless, I think you would know best if it would be benefit or not. So revert the change is fine to me in this case. |
Feature flags are often a good way, but it also comes with the cost of cluttering code with more and more conditions, especially when you have to maintain multiple deployment paths and some features are mutual. Reverting the change it currently the only reliable way to ensure that it works for all users regardless of their own configurations or plugin managers behavior. |
The changes introduced in PR GH-294 [1] did not take into account that the order how plugins are loaded are not always constant and can also change based on how users order plugins in their configurations. When a supported plugin is loaded after Nord the global `loaded_*` variable might not be available yet, causing the styles to be skipped due to the conditional block guard. Also each plugin manager handles the plugin loading order differently which is also a problem when checking for global variable existence. [1]: #294 [2]: #306 Fixes GH-306
The changes introduced in PR GH-294 [1] did not take into account that the order how plugins are loaded are not always constant and can also change based on how users order plugins in their configurations. When a supported plugin is loaded after Nord the global `loaded_*` variable might not be available yet, causing the styles to be skipped due to the conditional block guard. Also each plugin manager handles the plugin loading order differently which is also a problem when checking for global variable existence. The loading time of the Nord plugin is still totally fine so improving the stability for only a minimal performance boost is no negative trade at all (tested via `vim --startuptime timing.out`): 4.956ms: sourcing ~/.local/share/vim/plugged/nord-vim/colors/nord.vim [1]: #294 [2]: #306 Fixes GH-306
The changes introduced in PR GH-294 [1] did not take into account that the order how plugins are loaded are not always constant and can also change based on how users order plugins in their configurations. When a supported plugin is loaded after Nord the global `loaded_*` variable might not be available yet, causing the styles to be skipped due to the conditional block guard. Also each plugin manager handles the plugin loading order differently which is also a problem when checking for global variable existence. The loading time of the Nord plugin is still totally fine so improving the stability for only a minimal performance boost is no negative trade at all (tested via `vim --startuptime timing.out`): 4.956ms: sourcing ~/.local/share/vim/plugged/nord-vim/colors/nord.vim [1]: #294 [2]: #306 Fixes GH-306
Hi,
Thanks for the amazing color theme! :)
Unfortunately the PR #294 (or commit a4bf0a6) broke support for the gitsigns plugin as the required styles are no longer loaded.
Would you accept an PR for this?
Cheers
The text was updated successfully, but these errors were encountered: