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
Report error when setting a wrong guifont value #2089
Conversation
At the moment, this is not producing any message, though the log is going through just fine. I'm not familiar with Neovim's API, so perhaps I'm not using PS: I'm aware of the extra |
Also remove the extra column on the error message.
Alright, this is now working. I have two questions regarding the code though (sorry, first contribution!)
Thank you! |
The only thing left to do would be to also verify the fallback fonts. But if you are unsure how to do that, we can leave it for later in another PR. Basically, you need to try loading all of the fonts in the guifont list. BTW, I'm also on Discord so if you have further questions, you can ask there too. |
1. We use the nvim api directly elsewhere in the file, so I think removing the function makes sense. It's clear what writeline does.
2. I think tests are quite hard for this, since they would rely on the fonts installed on the system or require some mocking. Additionally, the actual functionality is quite trivial, so I don't think we need any tests.
Makes sense!
The only thing left to do would be to also verify the fallback fonts. But if you are unsure how to do that, we can leave it for later in another PR. Basically, you need to try loading all of the fonts in the guifont list.
That doesn't sound too difficult, I can try do that as well.
Essentially, walk the font list and try loading them until we get one
that does work? Or try load them all and report which ones failed?
BTW, I'm also on Discord so if you have further questions, you can ask there too.
o7
|
For the nvim API switch, see: neovim/neovim#5067
Also do a simple comma-separated join of font names instead of relying on `Debug` formatting.
This new macro accepts `format!`-like arguments and does both an `error!` log and a `ShowError` neovim command.
Fix `FontOptions::allow_float_size` not being set for float width values. Fix failed assert message formatting arguments being in incorrect order, or just completely incorrect.
809379d
to
8f5a56b
Compare
Thank you! |
Glad to help! :3
|
What kind of change does this PR introduce?
It addresses #2077 by fist implementing a new parallel
UiCommand
,ShowError { message: String }
which gets translated to neovim'sechomsg
, and then using it in tandem withlog::error!
inCachingShaper::update_font
(whenself.font_loader.get_or_load
fails).Did this PR introduce a breaking change?
guifont
values will now error out instead of silently being accepted. To pick no hinting or aliased edging, you should now use#h-none
and#e-alias
, respectively.Closes #2077