Skip to content

Commit

Permalink
project_panel: Fix entry not being marked when triggered via keyboard (
Browse files Browse the repository at this point in the history
…#25567)

This is follow-up for #25457

If you open a project without any open buffer, focus on the project
panel, navigate with arrows to a given entry, and hit space, you will
mark and open the file in the buffer. This is all correct. If you then
hit `escape` to clear the marked entries, nothing happens to the open
buffer, and the marked styled in the project panel entry go away. This
is all correct. The wrong behavior happens if you now hit space again on
the active entry. That should mark it, and thus change its styles, but
it doesn't happen. You just see it upon moving to a different entry with
arrow up/down.

Release Notes:

- Fixed project panel entry not being marked when triggering open action
via keyboard.

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
  • Loading branch information
0xtimsb and danilo-leal authored Feb 25, 2025
1 parent b12b834 commit 524e813
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/project_panel/src/project_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ impl ProjectPanel {
if let Some((_, entry)) = self.selected_entry(cx) {
if entry.is_file() {
self.open_entry(entry.id, focus_opened_item, allow_preview, cx);
cx.notify();
} else {
self.toggle_expanded(entry.id, window, cx);
}
Expand Down

0 comments on commit 524e813

Please sign in to comment.