Commit Graph
77 Commits
Author SHA1 Message Date
b485554e64 Take an Into<AnyViewHandle> in ChildView::new
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-27 17:54:45 +01:00
Max BrunsfeldandNathan Sobo 4b081bd128 Use Rust 2021 edition in all crates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 12:50:31 -08:00
Antonio ScandurraandMax Brunsfeld 3506c564d9 Alpha-blend borders with backgrounds in quad SDF
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-26 19:16:26 +01:00
Antonio ScandurraandNathan Sobo 506b462d53 Fix blending of quad's border with background
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 17:06:20 +01:00
Antonio ScandurraandNathan Sobo a92c3af8b1 Position underlines at a distance proportional to the line descent
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 16:03:06 +01:00
Antonio ScandurraandNathan Sobo b67959a504 Display squiggly underlines underneath text with diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 15:52:40 +01:00
Antonio Scandurra 1c65140dea WIP: Start on squiggly underlines 2022-01-26 13:07:39 +01:00
Max BrunsfeldandNathan Sobo d034a5d8dc Scale diagnostic header and message text with editor font
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-25 12:10:11 -08:00
Max BrunsfeldandNathan Sobo f429bdf96e Insert random delays when sending and receiving websocket messages in tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-24 16:37:22 -08:00
Nathan SoboandMax Brunsfeld b3cf3f1378 Get most tests passing when respecting wake order for foreground tasks in Deterministic executor
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-24 17:13:56 -07:00
Antonio Scandurra bbe3ca6d43 WIP: Start restructuring executor 2022-01-24 18:49:20 +01:00
Antonio Scandurra 70a6a9c7ee Remove executor::Foreground::Test
All code paths have already transitioned to `Foreground::Deterministic`.
2022-01-24 16:14:30 +01:00
Nathan Sobo 00985420cb Add ViewHandle::defer
It's like update, but happens after the current effect instead of synchronously. Also, it doesn't allow the callback to return a value because there would be nothing to do with it.
2022-01-22 13:21:59 -07:00
Nathan Sobo ae9fae29f1 Add a ViewContext::defer
This takes a closure that will be enqueued as an effect to ensure there are no entities on the stack.
2022-01-22 13:14:25 -07:00
Max BrunsfeldandNathan Sobo ab44402642 Flush effects after every spawned future completes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 17:43:24 -08:00
Nathan Sobo e9e76ee3ed Merge remote-tracking branch 'origin/main' into go-to-definition 2022-01-21 11:12:38 -07:00
Antonio ScandurraandNathan Sobo 620b6bd990 Allow observing the release of entities
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 14:34:14 +01:00
Nathan Sobo 8daf3ad771 When opening a path in an existing window, move it to the foreground 2022-01-20 20:45:30 -07:00
Antonio Scandurra 897e0b4a7a Return a task from Workspace::save_active_item
This required changing our approach to OS prompts and this commit greatly
simplifies that. We now avoid passing a callback and return a simple future
instead. This lets callers spawn tasks to handle those futures.
2022-01-20 09:51:29 +01:00
Max Brunsfeld 974374e29a Apply scroll_max after uniform list autoscrolls 2022-01-14 11:56:28 -08:00
Max Brunsfeld c48ad4015b Add bottom margin to the outline view 2022-01-14 11:01:20 -08:00
e1bf476b29 Add select_first and select_last bindings to outline view
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 10:45:37 -08:00
6372b5908e Center the selected item when updating outline query
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 17:53:06 +01:00
Max Brunsfeld 3dd4c39edd Incorporate syntax highlighting into symbol outline view
Still need to figure out how to style the fuzzy match characters
now that there's syntax highlighting. Right now, they are
underlined in red.
2022-01-13 18:10:02 -08:00
Max Brunsfeld 45672c4378 Add unit test for diagnostic + path header ordering 2022-01-12 11:34:57 -08:00
Max BrunsfeldandNathan Sobo 4b7584e1a2 Reuse views when moving between diagnostic view and editors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 11:00:12 -08:00
Antonio ScandurraandNathan Sobo c28fd392cb Refactor opening workspace items
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 17:38:37 +01:00
Max BrunsfeldandNathan Sobo 6f94450d4b Introduce Expanded element
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 17:35:45 -08:00
Max BrunsfeldandNathan Sobo 6551baa91e Unify Flexible and Expanded elements
We'll use the name Expanded for something else now.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 17:29:34 -08:00
Nathan SoboandMax Brunsfeld 517a1c6dc2 Report backtraces of pending conditions when deterministic executor illegally parks
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-06 13:33:55 -07:00
Nathan SoboandAntonio Scandurra 80e5915179 Allow disk-based diagnostic progress begin/end events to interleave
When multiple saves occur, we can have multiple start events followed by multiple end events. We don't want to update our project diagnostics view until all pending progress is finished.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-06 09:32:08 -07:00
Antonio ScandurraandNathan Sobo a56b3c7fb9 Polish rendering of inline errors
- Don't soft-wrap
- Render multiple lines

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 16:17:53 +01:00
Max Brunsfeld 59310ae90d Merge branch 'main' into polish-project-diagnostics
Also fix false failure in ModelHandle::condition when parking is not forbidden.
2022-01-05 10:53:18 -08:00
Max BrunsfeldandAntonio Scandurra 18c6b21e3c Replicate diagnostic summaries
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-04 14:29:22 -08:00
Max Brunsfeld f3f4b0f216 Remove unused context variable 2021-12-27 15:34:07 -08:00
Nathan SoboandAaron Hillegass 4783797471 Don't merge keymap contexts from containing elements
Co-Authored-By: Aaron Hillegass <charmedliferaft@gmail.com>
2021-12-24 16:44:35 -07:00
Max BrunsfeldandNathan Sobo a8488fee91 Merge branch 'main' into share-project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:42:59 -08:00
e6e633c69c Send worktree info only when sharing worktree
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:36:59 -08:00
Nathan Sobo 0ddef7d526 Fix warnings and tests 2021-12-18 11:06:07 -07:00
Nathan Sobo 712552cfa3 Halt keystroke dispatch immediately when we call a global action handler
Someday, we may want to define a global action context that allows us to propagate the action, but this isn't currently supported. Previous to this commit, we were invoking the same global action handler multiple times, once for each view in the responder chain.
2021-12-18 08:12:08 -07:00
Max Brunsfeld f831277317 Upgrade tree-sitter to 0.20.1 2021-12-05 21:37:08 -08:00
Antonio Scandurra 0ad6b0c1f6 Use 16-bit float to store path windings
Previously, we were using a normalized 8-bit unsigned integer which forced us
to represent each increment of the winding number as a fraction of the max
value (1 / 255) which we would then add up using additive alpha blending.

This had three major drawbacks:

- The max winding number could not be greater than 255.
- Adding up (1 / 255) several times could result in a loss of precision.
- Due to also computing anti-aliasing as a fractional winding number, we had to
  reduce the max winding number to 32. This was still not good enough because
  we would multiply a fractional value with `1 / 32`, thus introducing more and
  more loss of precision.

This commit changes the texture type to an `f16` which doesn't require the
division by 255 and enables greater precision in the computation of the
anti-aliased parts of a curve. Note how this also removes the limitation of 255
windings at most per curve. The tradeoff is paying twice as much memory for
storing the texture, but that seems totally valid to achieve rendering accuracy.

Note that this kind of texture should be compatible with WebGL2 once we start
working on a web version of Zed.
2021-12-05 11:17:26 +01:00
Antonio ScandurraandNathan Sobo 102c1ec10d Clear pending keystrokes after dispatching an action
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-03 17:59:46 +01:00
Antonio ScandurraandNathan Sobo 4ca4313b49 In add_option_view, avoid bumping view's ref counts if view is None
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-03 17:52:39 +01:00
Max BrunsfeldandNathan Sobo cf3093aace Start work on generalizing the BlockMap to allow arbitrary elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 15:25:55 -08:00
Nathan SoboandMax Brunsfeld 93322a4858 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Max BrunsfeldandNathan Sobo d51c033b98 Consolidate pending effects logic into MutableAppContext::update
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 14:16:19 -08:00
Max BrunsfeldandNathan Sobo ca11c68a19 Introduce weak_handle methods on ModelContext and ViewContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 14:13:22 -08:00
Max Brunsfeld b70cc651e5 Paint highlighted lines correctly when horizontally scrolled 2021-11-29 11:28:43 -08:00
Nathan Sobo 19dd12e1c6 Associate collaborator avatars with "ribbons" corresponding to their cursor color 2021-11-28 13:25:05 -07:00