Commit Graph

1370 Commits

Author SHA1 Message Date
Piotr Osiewicz
f011953484 Rename all_font_families to all_font_names 2024-01-16 20:32:21 +01:00
Julia
4e0c8dcea9 Revert "Use taffy to retrieve the parent for a given layout node"
This reverts commit 5904bcf1c2.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-16 10:44:24 -05:00
Thorsten Ball
f938bae0a2 Use NSScreen to fetch primary display
According to Chromium source, `NSScreen::screens` should always get us
one display.

We made this change because we ran into panics caused by the previous
`unwrap()` when `CGGetActiveDisplayList` might return an empty list.
2024-01-16 14:23:10 +01:00
Thorsten Ball
03bfe3ef80 Call CGGetActiveDisplayList once to avoid panic
Previously we called CGGetActiveDisplayList twice: once to get the
number of displays and then to get the displays.

We saw a panic due to no displays being returned here. As a first
attempt to fix the panic, we're reducing the amount of calls to
CGGetActiveDisplayList and just do one with the trade-off being that we
pre-allocate 32 pointers in a Vec.
2024-01-16 12:01:54 +01:00
Max Brunsfeld
deac172e39
Restore re-rendering of editors on buffer font size changes (#4064)
Now that views are cached, we need to explicitly `.notify()` text
editors when the buffer font size changes.

* [x] Notify editors when settings change, or adjusting buffer font size
* [x] Figure out why non-focused editors still do not re-render when
adjusting buffer font size
* [x] Reset buffer font size adjustment when the size is updated in the
user's settings
2024-01-15 17:13:13 -08:00
Max Brunsfeld
1e755aa00f Notify global observers when removing a global 2024-01-15 17:02:20 -08:00
Max Brunsfeld
8f1633e798 Iterate from leaf to root when marking views dirty in notify 2024-01-15 16:49:06 -08:00
Conrad Irwin
f0ed80cd8e Fix fallback font
As this is used if you mis-spell "buffer_font_family", it should be
monospace.

Also treat "Zed Mono" and "Zed Sans" as valid fonts
2024-01-15 14:32:48 -07:00
Antonio Scandurra
69bbcba99a Preserve tooltips requested by cached views
Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Max <max@zed.dev>
2024-01-15 19:19:27 +01:00
Antonio Scandurra
0ff5603dc9 Rebuild shader header when cbindgen sources have changed
Co-Authored-By: Thorsten <thorsten@zed.dev>
2024-01-15 16:23:22 +01:00
Piotr Osiewicz
e52a2298cc
gpui: Pin to font-kit with improved OTC parsing performance. (#4047)
Details are in https://github.com/zed-industries/font-kit/pull/1; We're
not doing anything too fancy, really. Still, you should mostly see font
loading times drop significantly for font collections
Release Notes:
- Improved loading performance of large font collections (e.g. Iosevka).
Fixes https://github.com/zed-industries/community/issues/1745,
https://github.com/zed-industries/community/issues/246


https://github.com/zed-industries/zed/assets/24362066/f70edbad-ded6-4c12-9c6d-7a487f330a1b
2024-01-15 15:46:18 +01:00
Antonio Scandurra
05d05b051b Pop node from dispatch tree during cx.paint_view
Co-Authored-By: Thorsten <thorsten@zed.dev>
2024-01-15 11:46:46 +01:00
Antonio Scandurra
4ff514ca7e Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/gpui/src/elements/div.rs
2024-01-15 11:37:46 +01:00
Conrad Irwin
29ce109211
chat panel ++ (#4044)
- Update chat panel with current channel
- Open chat panel for guests
- Open chat when joining a channel with guests
- Some tweaks for chat panels
- Don't lose focus on default panel state
- Make chat prettier (to my eyes at least)
- Fix multiple mentions in one message
- Show a border when scrolled in chat
- Fix re-docking chat panel
- Move settings subscription to dock

[[PR Description]]

Release Notes:

- Opens chat by default when joining a public channel
- Improves chat panel UI
2024-01-14 13:54:10 -07:00
Conrad Irwin
e90ddba2c3 Default to Zed Sans for UI 2024-01-13 22:38:22 -07:00
Conrad Irwin
818cbb2415 Show a border when scrolled in chat 2024-01-13 22:19:21 -07:00
Conrad Irwin
f6ef07e716 Make chat prettier (to my eyes at least) 2024-01-13 21:37:13 -07:00
Mikayla
5897b18cfd
remove more commented code 2024-01-12 20:10:40 -08:00
Mikayla
3a836b8026
Remove some comments 2024-01-12 20:10:40 -08:00
Nathan Sobo
d2c436dcdc
fix bounds checks (#4038)
Ensure we `panic()` instead of crash on graphics memory buffer overflow

Also bump the buffer size to 32Mb from 8Mb to make this rarer (but still
possible)

Release Notes: Fixes some crahes due to lack of graphics buffer spacae
2024-01-12 15:28:19 -08:00
Julia
cdc227b32f Still paint group hover handler for invisible divs
Fixes bug where tab close icon show on hover is inconsistent
2024-01-12 17:44:15 -05:00
Conrad Irwin
aa5c6a8aa3 Update graphics memory assert to be more helpful 2024-01-12 14:35:50 -07:00
Mikayla
324d1d119b
Add some context to assert 2024-01-12 12:40:37 -08:00
Conrad Irwin
551fd9ba7e Boop 2024-01-12 12:40:09 -07:00
Antonio Scandurra
817b641c17 Ensure editor elements invalidate their parent views on notify
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Conrad Irwin <conrad@zed.dev>
2024-01-12 17:36:11 +01:00
Antonio Scandurra
a32ad3f907 Fix editor tests 2024-01-12 14:50:42 +01:00
Antonio Scandurra
94293b3bf9 Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/gpui/src/window.rs
2024-01-12 14:31:13 +01:00
Piotr Osiewicz
8d294211db settings.json: Suggest font names for buffer_font_family 2024-01-11 23:23:10 +01:00
Piotr Osiewicz
a1049546a2 gpui: Validate font contents at load time.
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.
2024-01-11 23:23:10 +01:00
Conrad Irwin
a8b8be47e0 Don't hold platform lock while calling user callbacks
Inspired by a bug where using Edit -> Copy from the menu created a
deadlock.
2024-01-11 13:52:50 -07:00
Conrad Irwin
4d66ade332
Fix multi-key shortcuts (#4025)
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>)).
2024-01-11 11:36:51 -07:00
Conrad Irwin
51cc6b1e1c
Guard against infinite loop in focus handling (#4023)
Release Notes:

- Fix an infinite loop in focus handling
2024-01-11 11:26:37 -07:00
Conrad Irwin
23fe720ca6 Fix multi-key shortcuts
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
2024-01-11 11:24:55 -07:00
Piotr Osiewicz
a98d048905
gpui: Make TextSystem::line_wrapper non-fallible. (#4022)
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>
2024-01-11 18:52:00 +01:00
Conrad Irwin
06493471aa Guard against infinite loop in focus handling 2024-01-11 10:38:08 -07:00
Antonio Scandurra
11b433dc1c Move back to sorting entries in the depth map as we insert them 2024-01-11 18:24:07 +01:00
Antonio Scandurra
101cedb5f7 💄 2024-01-11 16:59:33 +01:00
Antonio Scandurra
cbbba41748 Reuse line layouts when reusing view 2024-01-11 16:57:06 +01:00
Antonio Scandurra
18eaefd0ed Reuse cursor style when reusing a view tree 2024-01-11 15:03:34 +01:00
Antonio Scandurra
50ccdf5c16 Reuse input handler when reusing a view tree 2024-01-11 13:22:59 +01:00
Antonio Scandurra
d088ace404 Explicitly push a node in the dispatch tree when painting a new view 2024-01-11 12:48:05 +01:00
Antonio Scandurra
142a8b68c8 Avoid casting view ids to u32
Also, it looks like using a u64 directly doesn't work well with Metal
shaders, so we unpack the u64 into two u32s.
2024-01-11 12:28:48 +01:00
Mikayla
83163a0031
Reverse context arrays in child predicate test 2024-01-10 19:54:39 -08:00
Mikayla
38396d4281
Add remaining tests
co-authored-by: Conrad <conrad@zed.dev>
2024-01-10 19:39:43 -08:00
Mikayla
a5ca58354d
Fix first few asserts 2024-01-10 18:26:01 -08:00
Mikayla
1932a298cb
Add back ime_key 2024-01-10 16:29:00 -08:00
Antonio Scandurra
a4ef1bc096 Rename reuse_geometry to reuse_view 2024-01-10 23:06:10 +01:00
Antonio Scandurra
1c260e6dfd Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/copilot/src/sign_in.rs
#	crates/gpui/src/window.rs
#	crates/workspace/src/pane_group.rs
2024-01-10 22:58:52 +01:00
Mikayla
f71a0cddb8
Remove last todos 2024-01-10 12:13:12 -08:00
Mikayla
4bcac68c8c
Restore GPUI test 2024-01-10 11:43:52 -08:00