Commit Graph
480 Commits
Author SHA1 Message Date
Conrad Irwin c0d85dc1dd Fix text wrapping when a child of a v_stack() (#3362)
Previously text that was rendered in a flex-column would reserve the
correct
amount of space during layout, and then paint itself incorrectly.

Release Notes:

- N/A
2023-11-19 11:37:31 -07:00
Conrad Irwin 0711121586 Add some test cases 2023-11-18 22:16:28 -07:00
Conrad Irwin cf47ed2c5f Fix wrapping when parent has a max_width
(Also avoid re-wrapping text we already wrapped)
2023-11-18 21:31:16 -07:00
Conrad Irwin 242a0b85b5 Update Taffy to latest main 2023-11-18 21:30:33 -07:00
Conrad Irwin 7172ce37b1 Fix text wrapping when a child of a v_stack() 2023-11-18 20:35:22 -07:00
Mikayla Maki e1285b9780 Add nightly release channel for zed2 (#3355)
Release Notes:

- N/A
2023-11-17 22:12:18 -08:00
Mikayla dd283b471a Add autoupdate2
co-authoredby: max@zed.dev
2023-11-17 15:48:32 -08:00
Julia 189ddf9380 Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:43:29 -05:00
Julia 3655a96e54 Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
Julia c6d22af416 Get diagnostic2 tests building and running 2023-11-17 16:32:35 -05:00
Julia a464a7da2a Merge branch 'main' into unborked-git-zed2-diagnostics-view 2023-11-17 16:32:35 -05:00
JuliaandNathan Sobo f4eb219c75 Get diagnostics view almost building in the zed2 world
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-11-17 16:32:35 -05:00
Mikayla Maki 7a8da8ce11 Adjust the type arrangement on ManagedViews (#3354)
Made the trait into a blanket-trait impl if you have it's two
constituent pieces (FocusableView and EventEmitter) to remove the
duplicated method. I also changed the struct to an enum for aesthetic
reasons (EventType::EventName feels self documenting to me) and added
some new `cx` APIs utilizing our new powers of dismissal.

Release Notes:

- N/A
2023-11-17 13:04:57 -08:00
Conrad Irwin a6d6f8a193 shhh (#3358)
- Fix image errors


Release Notes:

- N/A
2023-11-17 14:01:44 -07:00
Conrad Irwin 6bfe6fa0e1 Fix image errors
* Firstly only log one error per image load, not per frame
* Secondly use an Icon not an image for rendering Icons
2023-11-17 13:47:07 -07:00
Mikayla 149b9d1aa6 Merge branch 'main' into managed-view-adjustment 2023-11-17 12:40:44 -08:00
Conrad Irwin 624bd0a05a Collab ui2 (#3357)
* Clickable context menus & movable panels – what will they think of
next?!

Release Notes:

- N/A
2023-11-17 13:33:18 -07:00
Conrad Irwin ceb20dea96 Refactorings 2023-11-17 13:23:12 -07:00
Conrad Irwin 9d742b90c3 Allow you to click on a context menu item 2023-11-17 11:57:51 -07:00
Mikayla 17d53d0e38 Rename again, add fun cx APIs using new traits 2023-11-17 10:06:41 -08:00
Mikayla 01d9d53f4a Adjust the type arrangement on ManagedViews 2023-11-17 09:51:11 -08:00
Mikayla 1693718637 Merge branch 'main' into saving-2 2023-11-16 23:11:38 -08:00
Mikayla 9a3cd073c7 Restore a bunch of random workspace stuff 2023-11-16 23:05:28 -08:00
Nathan Sobo 2fb13cf1ca Separate WrappedLines from ShapedLines (#3350)
ShapedLines are never wrapped, whereas WrappedLines are optionally
wrapped if they are associated with a wrap width. Originally, when
rewriting GPUI, I tried to combine everything because wrapping is
inherently optional for the Text element, but we have a bunch of APIs
that don't make sense on a line that may wrap, so we need a distinct
type for that case.

This is a precursor to implementing clickable links in markdown. I
noticed multiple places where we were confused about whether or not the
line was wrapped so this felt important.

Release Notes:

- N/A
2023-11-16 23:20:35 -07:00
Nathan Sobo 9558da8681 Separate WrappedLines from ShapedLines
ShapedLines are never wrapped, whereas WrappedLines are optionally wrapped if
they are associated with a wrap width. I tried to combine everything because
wrapping is inherently optional for the Text element, but we have a bunch of
APIs that don't make sense on a line that may wrap, so we need a distinct type
for that case.
2023-11-16 23:10:51 -07:00
Conrad Irwin 2d1d75f482 +ManagedView
And some games with rust traits
2023-11-16 23:02:10 -07:00
Conrad Irwin 6d4276ea5f Merge branch 'main' into collab_ui2 2023-11-16 22:08:42 -07:00
Conrad Irwin c0ad15756c More attachment configuration for context menus 2023-11-16 21:59:23 -07:00
Max Brunsfeld e67c44a562 Fix file-reloading race condition (#3348)
### Summary

This PR fixes a bug that @as-cii and @osiewicz saw when the on-disk
contents of files changed due to running `git checkout` at the command
line. It caused a buffer's contents to diverge from the file's on disk
contents, but the buffer to show an *unmodified* status.

I've also introduced new APIs on gpui's deterministic executor, which
make it possible to write a test that reliably triggered the bug.

### Details

The bug is triggered by the following sequence of events:
1. A buffer's file changes on disk while the buffer is *unmodified*
2. Zed reloads the new content of the file
3. Before updating the buffer itself, Zed computes a *diff* between the
buffer's current contents, and the newly-loaded contents
4. While this diff is being computed, one of two things happens:
     1. the buffer changes on-disk *again*.
2. the user edits the buffer, but undoes the edit, so that the buffer
returns to an unmodified state

The bug itself was caused by a few things:
* The buffer diffing algorithm is pretty slow, because we perform a
character-wise diff
* We previously allowed multiple reload tasks to run concurrently
* When discarding an out-of-date diff, we failed to update parts of the
buffer's state (`saved_fingerprint`) which allow us to recognize that
the buffer's content differs from the file.

It was also difficult to reproduce the problem in tests, because under
deterministic execution, because it was extremely unlikely for other
tasks to make progress *after* a file had been reloaded, but *before*
the disk task has resolved. To help with testing, I introduced a pair of
executor APIs:

`spawn_labeled`, - for spawning a background task with a given *label*
`deprioritize_task` - for forcing tasks with a given label to run
*after* all other concurrent tasks.

I also made the `Model::next_event` test helper method more useful, in
that it no longer runs *until* parked in order to wait for the next
event to occur. It just steps the executor one poll at a time until the
model emits an event.

Release Notes:

- Fixed a bug that caused buffers to report incorrect modified/conflict
status when their buffers changed on disk multiple times in rapid
succession.
2023-11-16 20:19:16 -08:00
Max Brunsfeld 32979f3aca Rename deprioritize_task -> deprioritize
It applies to a family of tasks, not a task.
2023-11-16 20:03:18 -08:00
Max BrunsfeldandNathan Sobo f3b6719c76 Rename both PlatformDispatcher::poll and Executor::run_step to 'tick'
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-11-16 19:58:26 -08:00
Conrad Irwin 9547e88d88 TEMP 2023-11-16 19:50:31 -07:00
Mikayla 432572c592 #RemoveThe2 2023-11-16 18:04:35 -08:00
Mikayla 4de2c0f7ef Re-implement actions as derive macros instead of blanket impls 2023-11-16 17:32:02 -08:00
Conrad Irwin 074a221e0f Progress on ContextMenu 2023-11-16 16:59:27 -07:00
Max Brunsfeld f9650b3111 Don't run until all the way until parked when waiting for a model's next event 2023-11-16 15:54:00 -08:00
Max Brunsfeld 6397c05835 Add the ability to deprioritize specific labeled tasks in tests 2023-11-16 15:54:00 -08:00
Conrad Irwin 9456f716c2 Only send one right click event 2023-11-16 15:30:53 -07:00
Conrad Irwin 267e07472d Checkpoint, MenuHandle can open one 2023-11-16 13:32:19 -07:00
Mikayla a0e976599c Salvage old distributed slice code 2023-11-16 10:32:55 -08:00
Conrad Irwin d782426491 Dismiss tooltips on click 2023-11-16 10:26:09 -07:00
Kirill Bulatov fd61683c46 WIP 2023-11-16 10:40:02 +02:00
Kirill BulatovandMikayla Maki 61d6cb880c Start porting terminal_element to gpui2
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-11-16 10:04:03 +02:00
Mikayla 9da0b78ead Merge branch 'main' into tabs-n-splits 2023-11-15 23:41:25 -08:00
Conrad Irwin 74afa62a55 Add Overlay component to gpui2 2023-11-15 23:00:36 -07:00
Conrad Irwin 8c14a8fa95 Merge branch 'main' into collab_ui2 2023-11-15 21:04:47 -07:00
Conrad Irwin 0a9fb3978b Enable panel switching 2023-11-15 21:01:00 -07:00
Nathan Sobo e5ada92b7b Remove initialize from the Element trait (#3338)
Initially, we imagined registering keyboard handlers in the initialize
phase so we would understand the relationships between focus handles
during the layout pass, which would allow us to assign assign `focus_in`
styles that impact layout.

However, we soon realized that many elements aren't created until paint
time anyway, such as within the uniform list. Since it's impossible to
know prior to paint whether an element contains the focused element, it
makes more sense to eliminate the `focus_in` styling helper.

Release Notes:

- N/A
2023-11-15 19:36:35 -07:00
Mikayla 78cea69172 Add focusable view and restore workspace deserialization. Partially restore split and tab functions 2023-11-15 16:36:43 -08:00
Mikayla faf93aed4e checkpoint 2023-11-15 14:17:04 -08:00