-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Color scheme issue #3455
Comments
|
I have had a colorscheme working for a long time, recently broken. It is in a folder in .../micro/plug/colors/colorscheme-16.micro. When I launch micro, it yells at me "colorscheme-16 is not a valid colorscheme". When I open micro and press ctrl-e, set colorscheme colorscheme-16, it works properly for that instance. When I close micro and open again, the same issue arises. |
I was able to reproduce the issue by having a plugin set up like this: -- ~/.config/micro/plug/asd/asd.lua
local config = import("micro/config")
function preinit()
config.AddRuntimeFile("asd", config.RTColorscheme, "asd.micro")
end # ~/.config/micro/plug/asd/asd.micro
color-link cursor-line "#FF00FF" It seems that the issue is caused by micro attempting to load colorschemes before the plugin's
For now you can get around this by placing the colorscheme file directly in |
Yes, you're right, since the order of... Lines 322 to 330 in 5428b3f
...definitely affects this behavior, but it's just half of the truth, because we validate every option already in the moment we parse the settings (4663927) to be sure to work with fully valid settings and in the moment of validating the colorscheme settings we're still far away of adding the scheme via the plugin.So someone could indeed call it a regression, but this scenario is then hard to fix due to circle dependencies...at least at first sight.
Yes, I think this is and should be the common approach to load |
I just want to say that this appears as a regression in some existing popular color schemes, which were already loading via plugins, such as https://github.com/KiranWells/micro-nord-tc-colors. With this change, it seems to become impossible to distribute color schemes as plugins now? Can I also make a recommendation to disable the error/warning on startup entirely? The color scheme is set in settings.json, which I store in my dotfiles repo that I pull down on any new machine(s) I'm working on. I imagine this is a common workflow. I gitignore plugins, because those are separately versioned and may differ per workflow. So when pulling down my config on a new machine, I'm hit with an error on every startup, until I install the associated color scheme / plugin. On the other hand, if a color scheme is failing to load or is not installed, it should be readily apparent to the user as soon as they see the editor. The warning on startup is not actionable. It's just a nag. Nags are categorically not good UX design. |
Yes, but due to the design of
I don't think that it's a wise choice to "ignore" some kind of inconsistency in the config.
Yep, that is the current situation. But there is at least one way to bypass this with your dotfiles too. Why don't you maintain your own
Try to imagine some very simple colorschemes where only a few details should be highlighted, which could be overseen at the first sight. We can try to handle this "regression", but I find it difficult to prioritize. @dmaluka: |
But a stop-the-world style interruption at startup feels like a drastic overstep for a pretty niche case. Why doesn't this display as, say, a warning in the gutter after startup? The worst case being solved for here (a color scheme failed to load) is pretty benign, versus the jarring experience of the entire editor stopping in its tracks. It fails the principle of least surprise. |
Hmm, this plugin calls I wonder how many other plugins use this trick. ...Actually I've just found out that this trick is not something the plugin author came up with. This trick was suggested by @zyedidia: KiranWells/micro-nord-tc-colors#2 (comment) More and more interesting. BTW even before 2.0.14 it wasn't fully working: loading colorscheme specified in |
No, it is not apparent to the user why the colorscheme was not applied.
There may be multiple configuration errors at startup. With a "stop-the-world interruption" we can report them all to the user, one by one, whereas with a warning in the gutter we would only be able to show one of them. ...Let's think how to address the root issue (non-working colorschemes loading via plugins at startup, in particular with existing plugins), then we won't need to think how to hide its consequences. |
I think that all micro documentation should be included to each micro release instead beeing avaliable only online. Besides of above, your don't address setting colors for specific languages (for example: python, perl, etc.) 😜 |
It isn't just available online only as mentioned here & here: By tabbing after |
Environment
OS: Debian (bookworm)
Micro version: 2.0.13
Micro commit: 68d88b5
Issue
Taken steps
created a
colorschemes
folder inside of micro configuration foldercreated a colorscheme json file
Expected result
Apply of the colorscheme
Actual result
Error message:
even if the .json file syntax is correct
The text was updated successfully, but these errors were encountered: