Closes#21605
Consider you have set of entries selected or even a single entry
selected, and you right click some other entry which is **not** part of
your selected set. This doesn't not clear existing entries selection
(which it should clear, as how file manager right-click logic works, see
more below).
This issue might lead unexpected operation like deletion applied on
those existing selected entries. This PR fixes it.
Release Notes:
- Fix right click selection behavior in project panel
Closes#21266
Release Notes:
- Fixes not using the `panel.background` color in the file tree
See comments in https://github.com/zed-industries/zed/issues/21266 for
more details.
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Part of https://github.com/zed-industries/zed/issues/20925
This prototype is behind a feature flag and being merged to avoid
conflicts with further git-related resturctures.
To be a proper, public feature, this needs at least:
* showing deleted files
* better performance
* randomized tests
* `TODO`s in the `project_diff.rs` file fixed
The good thing is, >90% of the changes are in the `project_diff.rs` file
only, have a basic test and already work on simple cases.
Release Notes:
- N/A
---------
Co-authored-by: Thorsten Ball <thorsten@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
Closes https://github.com/zed-industries/zed/issues/12029
Allows to introspect project items inside items more deeply, checking
them for being dirty.
For that:
* renames `project::Item` into `project::ProjectItem`
* adds an `is_dirty(&self) -> bool` method to the renamed trait
* changes the closing logic to only care about dirty project items when
checking for save prompts conditions
* save prompts are raised only if the item is singleton without a
project path; or if the item has dirty project items that are not open
elsewhere
Release Notes:
- Fixed item closing overly triggering save dialogues
Closes#20845
I'm uncertain about my placement for the logic to remove actions from
the command palette list. If anyone has insights or alternative
approaches, I'm open to changing the code.
Release Notes:
- Removed project panel `Trash` action for remote projects.
---------
Co-authored-by: Finn Evers <dev@bahn.sh>
Closes#20858
This fix depends on the sanitization logic implemented in PR #20577.
Since that branch may undergo further changes, this branch will be
periodically rebased on it. Once #20577 is merged, the dependency will
no longer apply.
Release Notes:
- Fix missing or duplicated files when copying multiple items in the
project panel.
- Fix marked files not being deselected after selecting a directory on
primary click.
- Fix "copy path" and "copy path relative" with multiple items selected
in project panel.
**Problem**:
In this case, `dir1` is selected while `dir2`, `dir3`, and `dir1/file`
are marked. Using the `marked_entries` function results in only `dir1`,
which is incorrect.
<img height="120"
src="https://github.com/user-attachments/assets/d4d92cc5-c998-4948-9a58-25c4f54167f2"
/>
Currently, the `marked_entries` function is used in five actions, which
all produce incorrect results:
1. Delete (via the disjoint function)
2. Copy
3. Cut
4. Copy Path
5. Copy Path Relative
**Solution**:
1. `marked_entries` function should not use "When currently selected
entry is not marked, it's treated as the only marked entry." logic.
There is no grand scheme behind this logic as confirmed by piotr
[here](https://github.com/zed-industries/zed/issues/17746#issuecomment-2464765963).
2. `copy` and `cut` actions should use the disjoint function to prevent
obivous failures.
3. `copy path` and `copy path relative` should keep using *fixed*
`marked_entries` as that is expected behavior for these actions.
---
1. Before/After: Partial Copy
Select `dir1` and `c.txt` (in that order, reverse order works!), and
copy it and paste in `dir2`. `c.txt` is not copied in `dir2`.
<img height="170"
src="https://github.com/user-attachments/assets/a09fcb40-f38f-46ef-b0b4-e44ec01dda18"
/>
<img height="170"
src="https://github.com/user-attachments/assets/bb87dbe5-8e2e-4ca4-a565-42be5755ec8a"
/>
---
2. Before/After: Duplicate Copy
Select `a.txt`, `dir1` and `c.txt` (in that order), and copy it and
paste in `dir2`. `a.txt` is duplicated in `dir2`.
<img height="170"
src="https://github.com/user-attachments/assets/6f999d22-3607-48d7-9ff6-2e27494002f8"
/>
<img height="170"
src="https://github.com/user-attachments/assets/b4b6ff7d-0df7-45ea-83e4-50a0acb18457"
/>
---
3. Before/After: Directory Selection
Simply primary click on any file, now primary click on any dir. That
previous file is still marked.
<img height="170"
src="https://github.com/user-attachments/assets/9f1948ce-7445-4377-9733-06490ed6a324"
/>
<img height="170"
src="https://github.com/user-attachments/assets/e78203bc-96ba-424b-b588-c038992a9f0e"
/>
---
4. Before/After: Copy Path and Copy Path Relative
Upon `copy path` (ctrl + alt + c):
Before: Only `/home/tims/test/dir2/a.txt` was copied.
After: All three paths `/home/tims/test/dir2`, `/home/tims/test/c.txt`
and `/home/tims/test/dir2/a.txt` are copied.
This is also how VSCode also copies path when multiple are selected.
<img height="170"
src="https://github.com/user-attachments/assets/e20423ea-1682-4efd-b208-631e2edd3771"
/>
Closes#20444
- Focus on next file/dir on deletion.
- Focus on prev file/dir in case where it's last item in worktree.
- Tested when multiple files/dirs are being deleted.
Release Notes:
- Maintain selection on file/dir deletion in project panel.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Closes#4745
Release Notes:
- Added a new `file_scan_inclusions` setting to force Zed to index files
that match the provided globs, even if they're gitignored.
---------
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This PR introduces a new parameter for `on_drag` in gpui, which is an
offset from the element origin to the mouse event origin.
Release Notes:
- Fixed rendering of dragged project panel entries
With this PR, Git status is now the only thing that can change an item's
label color. So, the summary of how status colors operate in the project
panel is:
- Item icon color is, by default, never changed, _not_ affected by
either diagnostics or Git status
- This should become configurable in the near future, though
- However, a little x or triangle icon shows up on top of the file type
icon to display diagnostics status
- Label color is _not_ affected by diagnostics but it _is_ affected by
Git status
This aims to reduce color noise and clarify/simplify how each element is
affected.
Release Notes:
- N/A
This is a follow-up (or related to) #20412.
It fixes entries being marked when navigating between tabs with `cmd-[`
and `cmd-]`.
Turns out that deep in the bowels of the project panel, we check whether
a `shift` modifier was pressed - which is the case with `cmd-[` on a US
ANSI layout - and if so mark an entry.
I think that's a left-over, because all the other code paths that
select/reveal an entry mark it explicitly too.
Release Notes:
- Fixed entries in project panel being marked when navigating between
tabs with keybinding that uses `shift` modifier.
PR #20154 changed the project panel to focus the editor on click in case
preview tabs are disabled.
That lead to a flickering behavior: on mouse-down the border of the
still-selected entry in the project panel would flash, only to disappear
as soon as the entry was opened and editor focused.
This change fixes it by manually keeping track of the mouse-down state,
because we couldn't find a better solution that allows us to simply not
show the border while a "click" is going on.
Release Notes:
- Fixed project panel entries flickering the border when user clicks on
another entry to open it (when preview tabs are disabled.)
Co-authored-by: Piotr <piotr@zed.dev>
This addresses #17746 by marking entries when they're opened in the
project panel.
I think that was the original intention behind the code too, because it
explicitly marks entries before opening them. An event that is emitted
by the workspace reset the mark though.
So what I did was try to emulate the logic I saw in VS Code: when
opening the file, mark it, when the active entry changes, unmark it,
except if you explicitly marked a group of files.
Closes#17746
Release Notes:
- Changed project panel to mark files when opening them, which should
make it more intuitive to mark multiple files after opening a single
one.
PR #20154 introduced a regression and essentially disabled preview tabs
in code.
This fixes it and restores the old preview tabs behavior.
Release Notes:
- Fixed preview tabs being disabled in code, even if they were enabled
in the settings.
Co-authored-by: Piotr <piotr@zed.dev>
This fixes#15995 by adding a `project panel: remove from project`
action that can be used in a keybinding.
Release Notes:
- Added a `project panel: remove from project` action so that users can
now add a keybinding to trigger it: `project_panel::RemoveFromProject`.
Closes https://github.com/zed-industries/zed/issues/18255
Zed does not scroll always, but only if the item is out of sight, this
is preserved for now.
Otherwise, if the item is out of sight, project and outline panels + the
syntax tree view now attempt to scroll it into the middle, if there's
enough elements above and below.
Release Notes:
- Improved revealing items for outline and project panels (now center of the list is preferred)
Move click listener to outer div
- Avoids dead area when clicking the 1px border around a list item
- Avoids flickering cursor shape when moving the cursor above the list,
and especially when scrolling the list with a stationary cursor.
Closes#15614
Release Notes:
- Fixed mouse cursor shape flickering in project and outline panels when
crossing items
([#15614](https://github.com/zed-industries/zed/issues/15614))
---------
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Closes#4324
Release Notes:
- Fixed an issue where single-clicking on a file in the project panel
would not focus the editor, when preview tabs are disabled
This PR ensures that we do not have to break the indent guides settings
for the project/outline panel. In the future we might want to have a
more granular way to control when to show indent guides, or control
other indent guide properties, like its width.
Release Notes:
- N/A
Also change Zed's standard style to use
`.track_focus(&self.focus_handle(cx))`, instead of
`.track_focus(&self.focus_handle)`, to catch these kinds of errors more
easily in the future.
Release Notes:
- N/A
---------
Co-authored-by: Conrad <conrad@zed.dev>
This fixes a debug-only panic when processing filenames. The underflow
that happens in Preview/Stable shouldn't cause any issues (other than
maybe unmarking an entry in the project panel).
/cc @notpeter
Closes #ISSUE
Release Notes:
- N/A
See #12673https://github.com/user-attachments/assets/94079afc-a851-4206-9c9b-4fad3542334e
TODO:
- [x] Make active indent guides work for autofolded directories
- [x] Figure out which theme colors to use
- [x] Fix horizontal scrolling
- [x] Make indent guides easier to click
- [x] Fix selected background flashing when hovering over entry/indent
guide
- [x] Docs
Release Notes:
- Added indent guides to the project panel
- Fixes modal closing when using the remote modal folder
- Fixes a bug with local terminals where they could open in / instead of
~
- Fixes a bug where SSH connections would continue running after their
window is closed
- Hides SSH Terminal process details from Zed UI
- Implement `cmd-o` for remote projects
- Implement LanguageServerPromptRequest for remote LSPs
Release Notes:
- N/A
Supersedes https://github.com/zed-industries/zed/pull/19166
TODO:
- [x] Update basic zed paths
- [x] update create_state_directory
- [x] Use this with `NodeRuntime`
- [x] Add server settings
- [x] Add an 'open server settings command'
- [x] Make sure it all works
Release Notes:
- Updated the actions `zed::OpenLocalSettings` and `zed::OpenLocalTasks`
to `zed::OpenProjectSettings` and `zed::OpenProjectTasks`.
---------
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Richard <richard@zed.dev>