Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not save file with fallback file picker if TAB is used (use_system_path_prompts false) #21046

Open
1 task done
failable opened this issue Nov 22, 2024 · 2 comments
Open
1 task done
Labels
bug [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc workspace Feedback for workspace management, layout, interactions, etc

Comments

@failable
Copy link

failable commented Nov 22, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

  • mkdir -p a/b/c/d/e
  • zed a
  • Set "use_system_path_prompts": false
  • Create a new file
  • Save the file
  • Initial state
image
  • Input ./b
image
  • Move the cursor ./b/c/d/e/ and press TAB.
image
  • Input f.txt and press Enter.
image

Nothing happens and the file is not saved.

If TAB is not used and type the whole path manually, everything is just fine.

Environment

Zed: v0.163.2 (Zed Preview)
OS: macOS 15.1.1
Memory: 64 GiB
Architecture: aarch64

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

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@failable failable added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 22, 2024
@notpeter
Copy link
Member

I can reproduce:
Add "use_system_path_prompts": false, to your setting.json

mkdir -p /tmp/issue21046/a/b/c
zed /tmp/issue21046/

cmd-n
cmd-s
./a, down, down, tab, bar.txt

Workaround: press enter instead of tab.
Thanks for reporting.

@notpeter notpeter changed the title Can not save file in builtin file picker if TAB is used Can not save file with fallback file picker if TAB is used (use_system_path_prompts false) Nov 26, 2024
@notpeter
Copy link
Member

I believe this is the issue: tab is bound to picker::ConfirmCompletion while enter is bound to menu::Confirm:

{
"context": "Picker > Editor",
"bindings": {
"tab": "picker::ConfirmCompletion",
"alt-enter": ["picker::ConfirmInput", { "secondary": false }],
"cmd-alt-enter": ["picker::ConfirmInput", { "secondary": true }]
}
},

"enter": "menu::Confirm",

The latter works, the former does not. I'm not sure why these are distinct actions, but as a temporary workaround add the following to you keymap.json:

  {
    "context": "Picker > Editor",
    "bindings": {
      "tab": "menu::Confirm"
    }
  },

@notpeter notpeter added keymap / key binding Feedback for keyboard shortcuts, key mapping, etc workspace Feedback for workspace management, layout, interactions, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
Development

No branches or pull requests

2 participants