zed icon indicating copy to clipboard operation
zed copied to clipboard

Clicking a gitignored file in file tree does not focus the file

Open fvsch opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Steps to reproduce

  1. Open a folder as a project, where the folder contains three files:
.gitignore
is-ignored.txt
not-ignored.txt

and the contents of the .gitignore file is:

is-ignored.txt
  1. Open the file tree. In its starting state, no file should have a focused state.

  2. In the file tree, click on is-ignored.txt.

  3. Hit the F2 key.

Expected result

  • An editor for is-ignored.txt file is opened.
  • In the file tree, the focus is on the is-ignored.txt file.
  • In the file tree, the is-ignored.txt line is shown in filename editing mode.

Actual result

  • An editor for is-ignored.txt file is opened.
  • In the file tree, no file is selected.

Screenshot at the end of the steps to reproduce:

Screenshot 2024-01-26 at 14 52 14

Redoing the same steps but clicking not-ignored.txt instead shows a correct behavior:

Screenshot 2024-01-26 at 14 52 27

Environment

Zed: v0.119.19 (Zed) OS: macOS 14.3.0 Memory: 8 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

Log doesn't seem to have a related error for the STR above:

2024-01-26T13:59:10 [ERROR] crates/gpui/src/window.rs:376: window not found
2024-01-26T13:59:15 [INFO] ========== starting zed ==========
2024-01-26T13:59:15 [INFO] Opening main db
2024-01-26T13:59:16 [INFO] set environment variables from shell:/opt/homebrew/bin/fish, path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/florens/.local/share/mise/installs/node/20.10/bin:/Users/florens/.local/share/mise/installs/ruby/3.1/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/[email protected]/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/opt/mise/bin
2024-01-26T13:59:16 [ERROR] crates/zed/src/zed.rs:538: EOF while parsing a value at line 1 column 0
2024-01-26T13:59:16 [INFO] Opening main db
2024-01-26T13:59:16 [INFO] Opening main db
2024-01-26T13:59:19 [INFO] Opening main db

fvsch avatar Jan 26 '24 14:01 fvsch

Note that if there was another focused file, the focus remains on that file. With the test project described above:

  1. In the file tree, click on not-ignored.txt.
  2. In the file tree, click on is-ignored.txt.
  3. Hit the F2 key.

The not-ignored.txt will be focused and shown in filename editing mode.

Looks like a straightforward bug where clicking on a gitignored file in the file tree does not change the state of the file tree (though it does change the state of other parts of the editor).

fvsch avatar Jan 26 '24 14:01 fvsch

I can no longer reproduce this with Zed 0.146.4 so am going to close. If this is in error, please let me know and I'm happy to reopen. Thanks for reporting!

notpeter avatar Aug 04 '24 14:08 notpeter