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

Deleting a File via "Shift+d" keeps Shift-Key stuck #23449

Open
1 task done
Rocco-Gossmann opened this issue Jan 22, 2025 · 4 comments
Open
1 task done

Deleting a File via "Shift+d" keeps Shift-Key stuck #23449

Rocco-Gossmann opened this issue Jan 22, 2025 · 4 comments
Labels
project panel Feedback for files tree view reproducible Verified steps to reproduce included vim

Comments

@Rocco-Gossmann
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I recently wanted to start using the Default Keymaps, instead of using my own.
That is, when I found this Bug.

In the project_panel the shortcut for deleting a File or Folder is Shift+d / D.
The deletion itself works fine, but the project_panel does not realize, that the shift key was released afterwards.

Zed Version and System Specs

Zed: v0.169.2 (Zed)
OS: macOS 15.1.1
Memory: 8 GiB
Architecture: aarch64

If applicable, add screenshots or screencasts of the incorrect state / behavior

2025-01-22_07-05-45.mov

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

Zed.log

@JosephTLyons JosephTLyons added awaiting info Issue that needs more information from the user project panel Feedback for files tree view and removed triage labels Jan 22, 2025
@JosephTLyons
Copy link
Collaborator

JosephTLyons commented Jan 22, 2025

Hey @Rocco-Gossmann, which keymap are you using? Pulling up the default bindings for the various delete / trash actions in the project panel, I see:

"backspace": ["project_panel::Trash", { "skip_prompt": false }],
"delete": ["project_panel::Trash", { "skip_prompt": false }],
"cmd-backspace": ["project_panel::Trash", { "skip_prompt": true }],
"cmd-delete": ["project_panel::Delete", { "skip_prompt": false }],

Is shift+d your custom binding?

@Rocco-Gossmann
Copy link
Author

Hey @Rocco-Gossmann, which keymap are you using? Pulling up the default bindings for the various delete / trash actions in the project panel, I see:

"backspace": ["project_panel::Trash", { "skip_prompt": false }],
"delete": ["project_panel::Trash", { "skip_prompt": false }],
"cmd-backspace": ["project_panel::Trash", { "skip_prompt": true }],
"cmd-delete": ["project_panel::Delete", { "skip_prompt": false }],
Is shift+d your custom binding?

ZED has a different Default-Map for VIM-Mode.

Open the Command-Palette (cmd+shift+p) and search for vim: open default keymap.
I didn't see that since I'm not to familiar with all the possible ZED commands yet.

Image

Would have been cool to have this command as part of the normal Settings menu though.

Image

@devzeth
Copy link
Member

devzeth commented Feb 21, 2025

@Rocco-Gossmann can you give me a copy of the keymap setup you are using? I'm trying to reproduce the issue. Maybe lets start with trying in Zed Preview or Zed Stable and tell us if you still reproduce it, if so then provide us the keymap.json so we can try the same way you are showing us. Thank you!

@devzeth devzeth added the vim label Feb 21, 2025
@Rocco-Gossmann
Copy link
Author

@beniaminzagan
The Issue still persists to the newest Version.
You'll find my configs at the end of the comment.

I've been doing some testing.

It only happens, If you confirm the "Delete" Confirmation window via "Tab" followed by "Space" or "Return".
If you confirm the window using the Mouse, everything seems to be fine.

2025-02-22_07-19-44.mov

Configs:

settings.json (CMD+,)

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
	"telemetry": {
		"metrics": false
	},
	"features": { "inline_completion_provider": "none" },

	"ui_font_size": 16,

	"buffer_font_family": "JetBrainsMono Nerd Font",
	"buffer_font_size": 16,
	"show_wrap_guides": true,
	"wrap_guides": [80, 120],

	"current_line_highlight": "all",
	"vim_mode": true,
	"relative_line_numbers": true,

	"theme": {
		"mode": "system",
		"light": "Rosé Pine Dawn",
		"dark": "Rosé Pine"
	},

	"remove_trailing_whitespace_on_save": true,
	"format_on_save": "off",
	"hard_tabs": true,
	"tab_size": 4,

	"terminal": {
		"font_family": "JetBrainsMono Nerd Font Mono",
		"font_size": 16
	},

	"file_types": {
		"HTML": ["tpl"]
	},

	"languages": {
		"Go": {
			"format_on_save": "on"
		}
	}

	/* Version 0.170.2 fixed the bug, that required these workarounds
	"languages": {
		"TypeScript": { "language_servers": ["!vtsls"] },
		"JSON": { "language_servers": ["!vtsls"] },
		"JavaScript": { "language_servers": ["!vtsls"] },
		"JSX": { "language_servers": ["!vtsls"] },
		"HTML": { "language_servers": ["!vtsls"] }
	}
	*/
} 

Keymap.json (CMD+K CMD+S)

// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
	{
		"bindings": {
			// Remove default bindings
			"cmd-shift-i": null, // Format

			// My own VIM bindings
			"cmd-o": "projects::OpenRecent",
			"cmd-l": "pane::ActivateNextItem",
			"cmd-h": "pane::ActivatePrevItem",
			"cmd-n": "project_panel::ToggleFocus"
		}
	},

	{
		"context": "!Terminal",
		"bindings": {
			"ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
			"ctrl-j": ["workspace::ActivatePaneInDirection", "Down"],
			"ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
			"ctrl-l": ["workspace::ActivatePaneInDirection", "Right"]
		}
	},

	{
		"context": "ProjectPanel",
		"bindings": {
			"m a d": "project_panel::NewDirectory",
			"m a f": "project_panel::NewFile",
			"m m": "project_panel::Rename",
			"m d d": "project_panel::Trash"
		}
	},

	{
		"context": "!Workspace",
		"bindings": {
			"cmd-n": "workspace::ToggleLeftDock"
		}
	},


	{
		"context": "Editor && vim_mode==normal",
		"bindings": {
			//Code Actions (c)
			"space c c": "editor::ToggleComments",
			"space c r": "editor::Rename",

			//close commands (Z)
			"shift-z shift-z": [ "pane::CloseActiveItem", { "save_intent": "close" } ],
			"shift-z shift-q": [ "pane::CloseActiveItem", { "save_intent": "skip" } ],
			"shift-z shift-w": [ "pane::CloseActiveItem", { "save_intent": "save" } ],
			"shift-z shift-a": [ "workspace::CloseAllItemsAndPanes", { "save_intent": "close" } ]
		}
	},

	{
		"context": "Editor && vim_mode==visual",
		"bindings": {
			"J": "editor::MoveLineDown",
			"K": "editor::MoveLineUp",

			"space c c": ["workspace::SendKeystrokes", "m z g c escape ` z"]
		}
	},

	{
		"context": "Terminal",
		"bindings": {
			"cmd-k": "workspace::ToggleZoom",

			"ctrl-h": ["terminal::SendKeystroke", "ctrl-h"],
			"ctrl-j": ["terminal::SendKeystroke", "ctrl-j"],
			"ctrl-k": ["terminal::SendKeystroke", "ctrl-k"],
			"ctrl-l": ["terminal::SendKeystroke", "ctrl-l"]
		}
	}
]

@devzeth devzeth added reproducible Verified steps to reproduce included and removed awaiting info Issue that needs more information from the user bug [core label] labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project panel Feedback for files tree view reproducible Verified steps to reproduce included vim
Projects
None yet
Development

No branches or pull requests

3 participants