During layout of EditorElement we use 'm' character from current font to calculate sizes, panicking with fonts that do not have that character (e.g. Arabic fonts). It's not really EditorElement's fault, as it assumes that the font it's dealing with is gonna have that character available.
To prevent a crash, I added validation while loading a family that a given font contains the glyphs we're gonna use down the line.
An old fix was ported over from gpui1, and the two fixes could not exist
side-by-side. Delete this code and let the keymap handle it
Release Notes:
- (Added|Fixed|Improved) ...
([#<public_issue_number_if_exists>](https://github.com/zed-industries/community/issues/<public_issue_number_if_exists>)).
Editors WrapMap could become desynchronised if user had an invalid font
specified in their config. Compared to Zed1, WrapMap ignored the
resolution failure instead of panicking. Now, if there's an invalid font
in the user config, we just fall back to an arbitrary default.
Release Notes:
- Fixed the editor panic in presence of invalid font name in the config
(fixes https://github.com/zed-industries/community/issues/2397)
---------
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Also:
- Rename cx.on_blur to cx.on_focus_lost
- Fix a bug where notify calls in focus handlers were ignored
- Fix a bug where vim would get stuck in the wrong mode when switching
windows
Release Notes:
- (preview only) vim: fix switching between multiple windows
Also:
- Rename cx.on_blur to cx.on_focus_lost
- Fix a bug where notify calls in focus handlers were ignored
- Fix a bug where vim would get stuck in the wrong mode when switching
windows
This commit mostly fixes invalid URLs in docstrings. It also
encapsulates crates we reexport (serde stuff + linkme) into a public
module named "private" in order to reduce the API surfaced through docs.
Moreover, I fixed up a bunch of crates that were pulling serde_json in
through gpui explicitly instead of using Cargo manifest.
Release Notes:
- N/A
I essentially went through the publicly exported items and marked these
that are e.g. leaky reexports as pub(crate). I expect that'd be done on
Tuesday anyways.
Release Notes:
- N/A
* Fix an incorrect use of `Any::type_id` that prevented the disabling of
key bindings
* Restructured the representation of disabled key bindings so that they
handle context predicates correctly. Previously, to disable key binding,
you needed to supply the exact same context predicate (e.g. `Editor &&
mode == "full"`) as the binding that you are trying to disable. Now, the
context predicates of disabled key bindings are evaluated just like any
other context predicate (with the current context) to see if they apply.
Release Notes:
- Fixed an issue where disabling key bindings didn't work. To disable a
key binding, set it to `null` in your keymap.
This removes one of the path dependencies in gpui that's only really
needed by `workspace` (which can work around lack of these
implementations by itself). In theory it should also improve build
scheduling (as gpui doesn't have to wait for main dependency of sqlez -
libsqlite3 - to finish it's 25 seconds-long build in release), though in
practice I didn't notice a substantial improvement.
Moreover `sqlez` was unused by `settings` too, so that's removed
as well.
Release Notes:
- N/A
Adding guest roles led us down a rabbit hole where we'd have liked to
rely on a
side-effect of activating a window in tests; but the test window didn't
implement that.
Looking into that, I realized our TestWindow wasn't doing a great job of
emulating the MacWindow, so this makes the two more similar.
- `base_keymap` setting was not respected, now it is
- without a `~/.config/zed/keymap.json` file, we would fail to load the
*default* keymap
Co-authored-by: Marshall <marshall@zed.dev>
Previously it would both send the keydown *and then* the action, now
it send the action, and then because there was an action, does not send
the keydown
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
This PR updates the font resolution for shaped text to use the new
`resolve_font` method on the text system.
This makes it so we use the fallback font if the desired font cannot be
found rather than rendering nothing.
Release Notes:
- Fixed an issue where nothing would render when the font set in
`ui_font_family` was not found.
This PR adjusts our font resolution code to attempt to use a fallback
font if the specified font cannot be found.
Right now our fallback font stack is `Zed Mono`, followed by `Helvetica`
(in practice we should always be able to resolve `Zed Mono` since we
bundle it with the app).
In the future we'll want to surface the ability to set the fallback font
stack from GPUI consumers, and potentially even support specifying font
stacks in the user settings (as opposed to a single font family).
Release Notes:
- Fixed a panic when trying to load a font that could not be found.
After implementing it a while ago, our previous interpolation scheme
didn't really make sense to me and was causing borders to be rendered
incorrectly. We don't really draw backgrounds and borders as part of
the same draw call anymore, but it seemed reasonable to have a correct
implementation in the shader anyway.
This commit uses Porter-Duff compositing (i.e., `over`) to produce
a color that is the result of superimposing the border on top of the
background. Then, we linearly interpolate towards the background color
as we slide out of the border and into the background.