In the Windows test environment, the paths generated by `temp_tree()`
are symlink paths, which causes certain tests to fail.
I later noticed that when opening a project, we seem to always use
`canonicalize` to normalize the paths, as shown here:
https://github.com/zed-industries/zed/pull/21039.
This PR adopts a similar approach for the test environment to address
the issue.
Release Notes:
- N/A
Closes#23621
Change was in #23378. Also adds a comment to clarify why this is
inconsistent with all other uses of `bindings_for_action`.
Release Notes:
- N/A
There's still a bit more work to do on this, but this PR is compiling
(with warnings) after eliminating the key types. When the tasks below
are complete, this will be the new narrative for GPUI:
- `Entity<T>` - This replaces `View<T>`/`Model<T>`. It represents a unit
of state, and if `T` implements `Render`, then `Entity<T>` implements
`Element`.
- `&mut App` This replaces `AppContext` and represents the app.
- `&mut Context<T>` This replaces `ModelContext` and derefs to `App`. It
is provided by the framework when updating an entity.
- `&mut Window` Broken out of `&mut WindowContext` which no longer
exists. Every method that once took `&mut WindowContext` now takes `&mut
Window, &mut App` and every method that took `&mut ViewContext<T>` now
takes `&mut Window, &mut Context<T>`
Not pictured here are the two other failed attempts. It's been quite a
month!
Tasks:
- [x] Remove `View`, `ViewContext`, `WindowContext` and thread through
`Window`
- [x] [@cole-miller @mikayla-maki] Redraw window when entities change
- [x] [@cole-miller @mikayla-maki] Get examples and Zed running
- [x] [@cole-miller @mikayla-maki] Fix Zed rendering
- [x] [@mikayla-maki] Fix todo! macros and comments
- [x] Fix a bug where the editor would not be redrawn because of view
caching
- [x] remove publicness window.notify() and replace with
`AppContext::notify`
- [x] remove `observe_new_window_models`, replace with
`observe_new_models` with an optional window
- [x] Fix a bug where the project panel would not be redrawn because of
the wrong refresh() call being used
- [x] Fix the tests
- [x] Fix warnings by eliminating `Window` params or using `_`
- [x] Fix conflicts
- [x] Simplify generic code where possible
- [x] Rename types
- [ ] Update docs
### issues post merge
- [x] Issues switching between normal and insert mode
- [x] Assistant re-rendering failure
- [x] Vim test failures
- [x] Mac build issue
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
Co-authored-by: max <max@zed.dev>
Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Mikayla Maki <mikaylamaki@Mikaylas-MacBook-Pro.local>
Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
Co-authored-by: joão <joao@zed.dev>
The pattern in Zed and in other editors is to use `cmd` to modify some
file-opening action to open it in a split rather than in the current
pane.
- In the project pane, a `click` opens a file, and a `cmd-click` opens
it in a split
- In the file finder, `enter` opens the file, and a `cmd-enter` opens it
in a split
It makes sense to me that if `alt-enter` opens a file from the excerpt,
that `cmd-alt-enter` opens it in a split, following the pattern above.
Note: I'm not auto-merging this, as others might disagree.
Note: I didn't touch the Vim binding.
Release Notes:
- Breaking Change: Changed `editor: open excerpts split` key binding to
`cmd-alt-enter` on macOS and `ctrl-alt-enter` on Linux.
Follow-up to: https://github.com/zed-industries/zed/pull/23644
- Existing: `alt-enter` to open files from multi-buffer selections
- New: `alt-enter` to open multi-buffer from file selections
I updated the original PR changelog line.
Release Notes:
- N/A
Closes#12553
* [x] Fix `diff_hunk_before`
* [x] Fix failure to show deleted text when expanding hunk w/ cursor on
second line of the hunk
* [x] Failure to expand diff hunk below the cursor.
* [x] Delete the whole file, and expand the diff. Backspace over the
deleted hunk, panic!
* [x] Go-to-line now counts the diff hunks, but it should not
* [x] backspace at the beginning of a deleted hunk deletes too much text
* [x] Indent guides are rendered incorrectly
* [ ] Fix randomized multi buffer tests
Maybe:
* [ ] Buffer search should include deleted text (in vim mode it turns
out I use `/x` all the time to jump to the next x I can see).
* [ ] vim: should refuse to switch into insert mode if selection is
fully within a diff.
* [ ] vim `o` command when cursor is on last line of deleted hunk.
* [ ] vim `shift-o` on first line of deleted hunk moves cursor but
doesn't insert line
* [x] `enter` at end of diff hunk inserts a new line but doesn't move
cursor
* [x] (`shift-enter` at start of diff hunk does nothing)
* [ ] Inserting a line just before an expanded hunk collapses it
Release Notes:
- Improved diff rendering, allowing you to navigate with your cursor
inside of deleted text in diff hunks.
---------
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Cole <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Michael <michael@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
Co-authored-by: João <joao@zed.dev>
Also changed rust tasks to be less mouthful.
Release Notes:
- Shortened Rust task labels.
- Task modal will now use full task label when it does not require
truncation.
That's specifically when we're not rendering the user menu with an
Avatar. We were previously rendering a `ButtonLike` with unnecessary
flex styles there. Just a little fine-tune.
Release Notes:
- N/A
This PR disables the Assistant 2 Submit button when either there is no
message written in the editor or there's no model selected. To guide the
user, there will be a tooltip displayed on top of the button to indicate
what to do.
Release Notes:
- N/A
Fixes#23398Closes#23398
We'll bail on searches of files that we know are binary (thus even if we
were to find a match in them, they'd be thrown away by buffer loader).
Release Notes:
- Improved project search performance in worktrees with binary files
We don't want the zeta predictions entry to show in the assistant
context editor when completing slash commands. Zeta will still make
suggestions in the rest of the context editor, like the other providers
do.
Release Notes:
- N/A
This PR updates the `ListItem` component to not register an `on_click`
handler for `ListItem`s that are disabled.
When working on #23350 I noticed that even when the context menu entry
was disabled you could still click on the entry to fire the action.
Release Notes:
- Fixed some instances of disabled list items still registering clicks.
Closes#13979
Please review this approach to hide the permalink, or alternatively to
disable it instead?
Release Notes:
- The Copy Permalink menu item is now disabled when not in a Git
repository.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-Authored-By: Jon Walstedt <jon@walstedt.se>
Closes#22094
Release Notes:
- vim: Added support for ctrl-g
Co-authored-by: Jon Walstedt <jon@walstedt.se>
When clicking the checkbox label fire the toggle action.
At first I wasn't sure this is what we wanted, but after looking at a
few existing implementations of checkboxes with labels it seems like
this is reasonably standard.
Eventually this piece of UI will be updated to a CheckboxWithLabel, but
for now it is custom due to some specific style requirements.
Release Notes:
- N/A