Keith Simmons and Antonio Scandurra
2c656c63b8
Add global tests and wrap global update functions in update call to flush effects
...
Co-authored-by: Antonio Scandurra <me@as-cii.com >
2022-03-23 10:27:27 -07:00
Keith Simmons
48fc9f95fb
Add global change observations
2022-03-23 09:14:12 -07:00
Antonio Scandurra
6948924e9a
Fix global nested event test after turning subscriptions into effects
2022-03-23 09:14:33 +01:00
Max Brunsfeld and Nathan Sobo
4436301fa3
Coalesce followed view updates only within one frame
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-22 17:03:24 -07:00
Antonio Scandurra and Nathan Sobo
43eeb11192
Don't trigger observations with notifications emitted prior to observing
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-22 16:28:11 +01:00
Antonio Scandurra and Nathan Sobo
8d901860f2
Don't trigger global subscriptions with events emitted prior to subscribing
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-22 16:14:21 +01:00
Antonio Scandurra and Nathan Sobo
cd00947e17
Don't trigger subscriptions with events emitted prior to subscribing
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-22 15:57:30 +01:00
Antonio Scandurra
5e249ad324
Implement Workspace::unfollow
...
This also changes the structure of the follow state back to be per-pane. This
is because we can't share the same view state across different panes for
a couple of reasons:
- Rendering the same view in N different panes is almost always not something
that we want due to global state such as focus.
- If we allowed it and a user followed the same person in two different panes,
there would be no way of unfollowing in one pane without also unfollowing in
the other.
2022-03-21 16:55:18 +01:00
Max Brunsfeld
0be1a81fbb
Allow clicking a titlebar avatar to initiate following
2022-03-18 13:37:07 -07:00
Antonio Scandurra
55322903a9
WIP: Start on sending view updates to followers
2022-03-18 14:20:09 +01:00
Max Brunsfeld
2b916e4825
Add AnyWeakViewHandle
2022-03-17 17:53:38 -07:00
Antonio Scandurra and Nathan Sobo
53d7dfb195
Introduce workspace::register_project_item
...
This lets downstream crates like `editor` define how project items should be
opened.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-17 15:54:34 +01:00
Antonio Scandurra and Nathan Sobo
e158b79115
Rename app_state to global in gpui
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-17 14:33:01 +01:00
Antonio Scandurra
e2c28d19d1
Finish refactoring of how editors are opened
2022-03-17 11:29:46 +01:00
4c7d18530a
Remove workspace::Item trait
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Keith Simmons <keith@zed.dev >
Co-Authored-By: Antonio Scandurra <antonio@zed.dev >
2022-03-16 13:34:06 -07:00
Antonio Scandurra and Nathan Sobo
ec9e02b035
Fix edge cases when calling refresh_windows
...
This commit ensures that new views are rendered for the first time. This fixes
a panic that could be reproduced by dropping the `ThemeSelector` and opening
the file finder during the same update.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-16 14:51:54 +01:00
Antonio Scandurra and Nathan Sobo
bdd8bbb1da
Compute line-height as a multiple of font size
...
...instead of using the bounding box. This makes `PragmataPro` and other
fonts render more cleanly.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-15 16:35:06 +01:00
Antonio Scandurra
c2c68cbfe9
Start on implementing filtering support for Cursor::prev
2022-03-15 15:13:23 +01:00
Antonio Scandurra
6013fb8d0f
Make all HighlightStyle properties optional
...
Previously, some of those properties such the font weight, style and color
would be mandatory: when the theme didn't specify them, Zed would use a default
value during deserialization. This meant that those default properties would
unconditionally override the base text style, causing a rendering bug when
combining syntax highlights with diagnostic styles.
This commit fixes that by making `HighlightStyle`s more additive: each property
can be set independently and only the properties that theme specifies get
overridden in the base text style.
2022-03-15 10:39:43 +01:00
Max Brunsfeld and Antonio Scandurra
f796fa171b
Fix layout panic on empty editors with blocks
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-03-14 12:03:26 -07:00
Antonio Scandurra and Nathan Sobo
dae6a540b5
Hold strong handle in ChildView
...
This eliminates a whole class of errors where the `ChildView` could
be referring to a view that doesn't exist anymore. That probably still
indicates that there's an underlying bug, but at least we won't panic.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-14 15:49:11 +01:00
Antonio Scandurra and Nathan Sobo
351477793b
Don't draw scene elements if their size is zero
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-14 15:29:18 +01:00
Antonio Scandurra
b348cc77ee
Merge pull request #596 from zed-industries/fix/dropped-subscription-in-callback
...
Fix Dropped Subscription in Handler Bug
2022-03-12 19:14:38 +01:00
Keith Simmons
3780ef3840
Format including missing formatting changes from previous PR
2022-03-11 15:38:01 -08:00
Keith Simmons
727188bbd2
Add some tests for global events and fix potential bug in subscriptions when subscription is dropped inside of it's own callback
...
Co-authored-by: Nathan Sobo <nathan@zed.dev >
2022-03-11 15:34:04 -08:00
Nathan Sobo
2c6d8e9d65
Merge branch 'main' into select-on-rename
2022-03-11 15:30:07 -07:00
Keith Simmons and Max Brunsfeld
1c794540cb
Merge pull request #576 from zed-industries/cursor-shape
...
Add support for rendering the cursor as a Block and Underscore
Co-authored-by: Max Brunsfeld <max@zed.dev >
2022-03-11 11:51:24 -08:00
Keith Simmons
15dea6ede0
Minor renames for clarity
2022-03-11 11:25:36 -08:00
Keith Simmons
a3270225fb
Add global events to MutableAppContext and raise global event when new workspace is created
2022-03-10 20:03:01 -08:00
Keith Simmons
ce78fcac2a
Merge pull request #563 from zed-industries/mouse-history-navigation
...
Add missing mouse button events and mouse history navigation
2022-03-10 17:39:36 -08:00
Nathan Sobo
fe88d384a5
When renaming, match the color of the renamed token in the rename editor
2022-03-10 16:38:45 -07:00
Nathan Sobo
ebdba1d0c8
When renaming, fade out the old name and select all
2022-03-10 14:55:31 -07:00
Keith Simmons
9a43037620
render character under block cursor
2022-03-10 13:16:31 -08:00
Nathan Sobo
1e76d109a3
WIP
2022-03-10 11:32:14 -07:00
Nathan Sobo
150fdc71af
Start on text highlight support
2022-03-09 20:51:35 -07:00
Keith Simmons
c24e0bb8a4
Switch to using mouse navigation events instead of other in order to get rid of opaque button id
2022-03-09 15:04:04 -08:00
Antonio Scandurra
fd5218858d
Remove delegate support from GPUI
...
We added this because we thought it would save some allocations when
sending operations given that we could move them to the delegate upon
notifying it, but the reality is that we serialize operations and that
only requires a reference.
2022-03-09 10:48:52 +01:00
b737df955d
Add missing mouse button events and mouse history navigation
...
Co-Authored-By: Max Brunsfeld
Co-Authored-By: Nathan Sobo
2022-03-08 15:45:36 -08:00
111d5305ea
Remove language servers from buffers
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Antonio Scandurra <antonio@zed.dev >
Co-Authored-By: Keith Simmons <keith@zed.dev >
2022-03-08 15:16:07 -08:00
Antonio Scandurra
533a7c103f
Implement {ModelHandle,ViewHandle}::become_delegate
2022-03-08 09:30:32 +01:00
Nathan Sobo
19103d3388
WIP: Start on a delegation... like events, but single consumer that takes ownership of event
2022-03-08 09:01:57 +01:00
Max Brunsfeld
cbbce54587
Merge pull request #542 from zed-industries/guest-disconnections
...
Send heartbeats in both directions so the server can detect when clients disconnect
2022-03-07 15:52:35 -08:00
a5c807cd7a
Reset peer's receive timeout when a message is received
...
* Make advance_clock more realistic by waking timers in order,
instead of all at once.
* Don't advance the clock when simulating random delays.
Co-Authored-By: Keith Simmons <keith@zed.dev >
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-07 15:33:43 -08:00
Nathan Sobo
8f7656397c
Halt keystroke dispatch when a global action is dispatched
2022-03-06 09:46:33 -07:00
Max Brunsfeld
86d1ba1d65
Fix errors from conditional compilation in timer functions
2022-03-04 17:16:17 -08:00
Max Brunsfeld and Nathan Sobo
8e64d68d04
Make timer method available on both foreground and background executors
...
Also, make it return a static future.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-04 13:54:07 -08:00
Antonio Scandurra and Nathan Sobo
6804d9c5d6
🎨
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-04 17:54:48 +01:00
Antonio Scandurra and Nathan Sobo
4892dcd9a0
Disable events when project becomes read-only
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-04 17:37:37 +01:00
Antonio Scandurra and Nathan Sobo
22abec451f
Blur focused view when project becomes read-only
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-04 17:37:26 +01:00
Max Brunsfeld
6d89c1c69e
Don't insert input into editors when control or command keys are held
...
This is a follow-up to #475
2022-03-02 14:09:46 -08:00