Skip to content

Delay persists on ctrl-k shortcut after unbind all composed shortcuts #15731

Closed
@katry0

Description

@katry0

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

In older versions of Zed was possible to get rid of annoying delay of ctrl-k shortcut by unbinding all composed shortcuts starting with ctrl-k. In version 146.5 and probably in several older ones this functionality does not work. I updated keymap.json by the newest default keymap (https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-linux.json) but the the delay on ctrl-k shortcut persists.

It can be something simple, like new default shortcut missing in default keymap file.

To avoid further similar problems may help if the prefix `ctrl-k' could be globally unbind or remapped to another shortcut like I suggeted in this issue: #14181.

EDIT:
Version 145.1 is last version without this bug.

EDIT 2:
Compiled my own build of zed with debug log placed in /crates/gpui/src/keymap/binding.rs:30 logging every binding when it is loaded and it all original ctrl-k bindings seems replaced with "zed::NoAction". Bug will be somewhere else.

EDIT 3:
Found and fixed source of the issue: #15744
Code in MR may need rewrite by someone with better overview of the project.

Environment

OS: Archlinux
Version: 146.5

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

My updated keymap.json based on default:

[
	{
		"bindings": {
			"ctrl-k ctrl-n": null,
			"ctrl-k ctrl-p": null
		}
	},
	{
		"context": "Editor",
		"bindings": {
			"ctrl-k ctrl-r": null,
			"ctrl-p ctrl-r": "editor::RevertSelectedHunks",
			"ctrl-k ctrl-d": null,
			"ctrl-p ctrl-d": ["editor::SelectNext", { "replace_newest": true }],
			"ctrl-k ctrl-shift-d": null,
			"ctrl-p ctrl-shift-d": [
				"editor::SelectPrevious",
				{ "replace_newest": true }
			],
			"ctrl-k ctrl-i": null,
			"ctrl-p ctrl-i": "editor::Hover",
			"ctrl-k r": null,
			"ctrl-p r": "editor::RevealInFileManager",
			"ctrl-k p": null,
			"ctrl-p p": "editor::CopyPath",
			"ctrl-k v": null,
			"ctrl-p v": "markdown::OpenPreviewToTheSide",
			"ctrl-k ctrl-u": null,
			"ctrl-k ctrl-l": null,

			"ctrl-k": "editor::DeleteLine"
		}
	},
	{
		"context": "Pane",
		"bindings": {
			"ctrl-k u": null,
			"ctrl-p u": "pane::CloseCleanItems",
			"ctrl-k w": null,
			"ctrl-p w": "pane::CloseAllItems",
			"ctrl-k up": null,
			"ctrl-p up": "pane::SplitUp",
			"ctrl-k down": null,
			"ctrl-p down": "pane::SplitDown",
			"ctrl-k left": null,
			"ctrl-p left": "pane::SplitLeft",
			"ctrl-k right": null,
			"ctrl-p right": "pane::SplitRight"
		}
	},
	{
		"context": "Workspace",
		"bindings": {
			"ctrl-k s": null,
			"ctrl-p s": "workspace::SaveWithoutFormat",
			"ctrl-k ctrl-s": null,
			"ctrl-p ctrl-s": "zed::OpenKeymap",
			"ctrl-k ctrl-t": null,
			"ctrl-p ctrl-t": "theme_selector::Toggle",
			"ctrl-k m": null,
			"ctrl-p m": "language_selector::Toggle",
			"ctrl-k ctrl-left": null,
			"ctrl-p ctrl-left": ["workspace::ActivatePaneInDirection", "Left"],
			"ctrl-k ctrl-right": null,
			"ctrl-p ctrl-right": ["workspace::ActivatePaneInDirection", "Right"],
			"ctrl-k ctrl-up": null,
			"ctrl-p ctrl-up": ["workspace::ActivatePaneInDirection", "Up"],
			"ctrl-k ctrl-down": null,
			"ctrl-p ctrl-down": ["workspace::ActivatePaneInDirection", "Down"],
			"ctrl-k shift-left": null,
			"ctrl-p shift-left": ["workspace::SwapPaneInDirection", "Left"],
			"ctrl-k shift-right": null,
			"ctrl-p shift-right": ["workspace::SwapPaneInDirection", "Right"],
			"ctrl-k shift-up": null,
			"ctrl-p shift-up": ["workspace::SwapPaneInDirection", "Up"],
			"ctrl-k shift-down": null,
			"ctrl-p shift-down": ["workspace::SwapPaneInDirection", "Down"],
			"ctrl-k ctrl-b": null
		}
	},
	{
		"context": "Editor && mode == full",
		"bindings": {
			"ctrl-k enter": null,
			"ctrl-p enter": "editor::OpenExcerptsSplit"
		}
	},
	{
		"context": "AssistantPanel",
		"bindings": {
			"ctrl-k h": null,
			"ctrl-p h": "assistant::DeployHistory",
			"ctrl-k l": null,
			"ctrl-p l": "assistant::DeployPromptLibrary"
		}
	}
]

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

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[core label]keybindsKeyboard shortcuts, mapping, binding, keymaps, etcperformanceFeedback for performance issues, speed, memory usage, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions