Commit Graph
1389 Commits
Author SHA1 Message Date
Julia c4a028d38d Make was_top_layer_under_active_drag more closely match logic of was_top_layer (#4222)
Release Notes:

- N/A
2024-01-23 14:04:49 -05:00
JuliaandMax Brunsfeld 21d6751c48 Make was_top_layer_under_active_drag more closely match logic of was_top_layer
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2024-01-23 12:44:23 -05:00
Conrad Irwin 61dfec2b75 Add keymatch modes so terminal can have cmd-k (#4219)
This isn't my favorite idea of a fix, but it does work for now, and it
seems likely the terminal will need to configure other aspects of action
dispatch in the future.

In the future we should explore making it possible to do this via the
keymap, either by making disabling bindings more robust; or by having a
way to indicate immediate mode per binding.

Release Notes:

- Fixed a bug where cmd-k in terminal took 1s
2024-01-23 10:23:45 -07:00
Conrad Irwin 056da0a0f1 Add keymatch modes so terminal can have cmd-k
This isn't my favorite idea of a fix, but it does work for now, and it
seems likely the terminal will need to configure other aspects of action
dispatch in the future.

In the future we should explore making it possible to do this via the
keymap, either by making disabling bindings more robust; or by having a
way to indicate immediate mode per binding.
2024-01-23 09:37:44 -07:00
Thorsten BallandAntonio bf843e2131 Cache last used layer_id for StackingOrder
This optimizes rendering time by saving computation of the layer_id and
comparison when inserting it into the `BTreeMaps`.

Co-authored-by: Antonio <antonio@zed.dev>
2024-01-23 11:46:11 +01:00
Conrad Irwin 5a9f1e4eb7 fix local collab tests (#4209)
I was unable to run the collab tests locally because I would run out of
file descriptors.

From some digging it turned out that tokio allocates a new file
descriptor to do work on the CurrentThread using KQUEUE.

We create a new tokio Runtime with each database connection, and these
database connections were being retained by the Client, which is
retained by the Context.

Cleaning up our leaked contexts (and an unrelated retain cycle in the
UserStore) fixes the problem (though does make me
wonder if a different approach might be preferrable).

Release Notes:

- N/A
2024-01-22 23:17:23 -07:00
Conrad Irwin d4e83e48bd Fix docs 2024-01-22 23:10:53 -07:00
Conrad Irwin 0b1b758f02 Fix leaking test contexts
I was unable to run the collab tests locally because I would run out of
file descriptors.

From some digging it turned out that tokio allocates a new file
descriptor to do work on the CurrentThread using KQUEUE.

We create a new tokio Runtime with each database connection, and these
database connections were being retained by the Client, which is
retained by the Context.

Cleaning up our leaked contexts fixes the problem (though does make me
wonder if a different approach might be preferrable).
2024-01-22 23:05:54 -07:00
Mikayla a241a13d60 fix test 2024-01-22 19:42:25 -08:00
Mikayla 938b84c045 Finish documenting GPUI 2024-01-22 19:33:45 -08:00
Mikayla eab2e21126 Document more styling functions 2024-01-22 19:31:31 -08:00
Mikayla a99d5b87e8 WIP: text_system 2024-01-22 19:30:40 -08:00
Mikayla 0c3fb449f0 Document geometry 2024-01-22 19:30:40 -08:00
Mikayla 1902df9316 WIP: Start geometry crate 2024-01-22 19:30:40 -08:00
Mikayla 1f94463ce2 Switch Arc<Mutex<Keymap>> to Rc<RefCell<Keymap>>, a relic of the GPUI2 port.
Make gpui pass clippy
2024-01-22 19:30:38 -08:00
Kirill BulatovandPiotr a75fa35a08 Fix the fonts panic
co-authored-by: Piotr <piotr@zed.dev>
2024-01-23 00:23:48 +02:00
Conrad Irwin 2445df8bdd Remove unused import? 2024-01-22 13:37:14 -07:00
Conrad Irwin a1c4716eeb Potential fix for #2422 (#4197)
- it seems like layer.drawable_size() is 0,0 in metal_renderer.rs:189 
- we set this in two places:
    - in response to a CALayerDelegate setFrameSize: event
- in response to a CALayerDelegate viewDidChangeBackingProperties:
event.
- it looks like if we don't set it in either of these cases we get a
different failure mode: the view is zoomed just wrong.
- That said, I can reproduce the screenshot if .scale_factor() returns
0.
- This might happen if [nativeWindow screen] is nil, which happens when
the window is off screen.
    - possible that zed started with offscreen window?
- I would expect that viewDidChangeBackingProperties would fire when
that changed.
    - potential fix: default to 2.0

Release Notes:

- Fixed Zed occasionally rendering blank on laungh
([#2422](https://github.com/zed-industries/community/issues/2422)).
2024-01-22 11:25:02 -07:00
Mikayla Maki e896941981 Fix certain hovers being cut off (#4196)
Release Notes:

- Fixes a bug where the bottom of hover popovers would be cut off
([#2434](https://github.com/zed-industries/community/issues/2434)).
2024-01-22 10:19:39 -08:00
Conrad Irwin 72cb865108 jk (#4189)
Add support for mapping `jk` to escape in vim mode.

This changes the behaviour of the keymatches when there are pending
matches.

Before: Even if there was a pending match, any complete matches would be
triggered and the pending state lost.

After: If there is a pending match, any complete matches are delayed by
1s, or until more keys are typed.

Release Notes:

- Added support for mapping `jk` in vim mode
([#2378](https://github.com/zed-industries/community/issues/2378)),
([#176](https://github.com/zed-industries/community/issues/176))
2024-01-22 11:12:43 -07:00
Conrad Irwin 41a99c686b Potential fix for #2422 2024-01-22 11:10:15 -07:00
Mikayla 6419df82ee Fix certain hovers being cut off 2024-01-22 09:49:07 -08:00
Conrad Irwin c49477746e TYPO 2024-01-22 09:56:59 -07:00
Conrad Irwin 0903d29ab3 Improve logic for reused bindings, add docs. 2024-01-22 09:53:04 -07:00
JuliaandAntonio Scandurra 3b3252b040 Rewrote and documented was_top_layer logic
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-22 11:50:47 -05:00
JuliaandAntonio Scandurra 455d5eeb89 Preserve stacking order ID order when reusing cached view state
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-22 10:50:52 -05:00
Conrad Irwin 6c4d024237 TYPO 2024-01-22 08:40:21 -07:00
Conrad Irwin c5d7c8e122 Fix cmd-k left 2024-01-22 08:38:20 -07:00
Julia 831769ce8c Ignore stacking order entry ids in was_top_layer 2024-01-22 10:16:59 -05:00
JuliaandNathan Sobo 2c3d9805a4 Store a z-index id per-layer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2024-01-22 10:16:59 -05:00
Conrad Irwin 7ec4f22202 de-dbg! 2024-01-22 08:14:30 -07:00
Antonio Scandurra de64de22a3 Introduce a ZED_MEASUREMENTS env var and use it to measure frame time 2024-01-22 11:39:20 +01:00
Conrad Irwin b9c7bafc80 Merge remote-tracking branch 'origin/main' into jk 2024-01-21 22:03:54 -07:00
Conrad Irwin 4143d3a36e Work on tests 2024-01-21 22:00:35 -07:00
Mikayla b65cae5874 Moved Frame struct into element context, to be close to it's associated methods 2024-01-21 20:52:24 -08:00
Mikayla c05edee2b5 Port the rest of the app 2024-01-21 20:26:33 -08:00
Mikayla df4566fd1e Refactor out element context from GPUI 2024-01-21 19:43:35 -08:00
Conrad Irwin 9d261cf859 Merge branch 'main' into jk 2024-01-21 20:36:18 -07:00
Conrad Irwin 8c541b4930 Comment out tests for nwo 2024-01-21 20:16:14 -07:00
Conrad Irwin b06e2eb6af Update handling of 'pending' keys
Before this change if you had a matching binding and a pending key,
the matching binding happened unconditionally.

Now we will wait a second before triggering that binding to give you
time to complete the action.
2024-01-21 20:12:01 -07:00
Mikayla 2f9958621b Do an initial pass on refactoring out ElementContext from WindowContext 2024-01-21 18:40:20 -08:00
Mikayla Maki a8990baaac Document more gpui (#4187)
Also add several `TODO!(docs)` comments to places that need more
feedback.

Release Notes:

- N/A
2024-01-21 15:10:04 -08:00
Mikayla 118a3461a7 Restore erronously removed APIs 2024-01-21 14:33:34 -08:00
Mikayla 660a391806 Fix typos, mark docs related todos in GPUI 2024-01-21 14:28:40 -08:00
Mikayla aa57a4cfbc Document / lockdown more of GPUI 2024-01-21 14:26:45 -08:00
Conrad Irwin b8ed83a452 Refactor key dispatch to work in terms of bindings 2024-01-21 12:27:26 -07:00
Piotr Osiewicz 6c82380232 chore: Fix clippy::needless_borrow up to an editor 2024-01-21 15:03:24 +01:00
Thorsten Ball 29e74a648f When searching in visual mode switch to normal mode (#4178)
This matches Neovim behaviour by setting the mode to `Normal` when using
search while in visual mode.

Release Notes:

- Fixed Vim mode not switching to normal mode from visual mode when
using search (`/`) while in visual mode.
2024-01-21 08:42:47 +01:00
Mikayla 476de329b3 Fix issues in element comment 2024-01-20 20:19:01 -08:00
Mikayla 2083fdcaf6 Fix compile issue 2024-01-20 20:15:43 -08:00