zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.59k stars 2.64k forks source link

[linux wayland] the ctrl-w key command is too slow #14540

Open l-7-l opened 1 month ago

l-7-l commented 1 month ago

same here on linux. editor: version: Zed Preview 0.144.2 code: image

os:

                   -`                    l-7-l@bb8 
                  .o+`                   --------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: Vivobook_ASUSLaptop M7600QE_M7600QE 1.0 
               `+oooooo:                 Kernel: 6.9.7-zen1-1-zen 
               -+oooooo+:                Uptime: 12 hours, 57 mins 
             `/:-:++oooo+:               Packages: 1203 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.9 
           `/++++++++++++++:             Resolution: 3840x2400 
          `/+++ooooooooooooo/`           DE: GNOME 46.3.1 
         ./ooosssso++osssssso+`          WM: Mutter 
        .oossssso-````/ossssss+`         WM Theme: Adwaita 
       -osssssso.      :ssssssso.        Theme: Adwaita [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Adwaita [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: gjs 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 9 5900HX with Radeon Graphics (16) @ 4.680GHz 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce RTX 3050 Ti Mobile 
 `++:.                           `-/+/   GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series 
 .`                                 `/   Memory: 9315MiB / 15389MiB 

录屏 2024-07-16 13-47-01.webm

Originally posted by @l-7-l in https://github.com/zed-industries/zed/discussions/8274#discussioncomment-10058202

settings:

// 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 the `open default settings` command
// from the command palette or from `Zed` application menu.
{
    "base_keymap": "VSCode",
    "nightly": {
        "current_line_highlight": "all"
    },
    "vim_mode": true,
    "ui_font_size": 18,
    "buffer_font_size": 18,
    "buffer_font_family": "Comic Mono",
    "preferred_line_length": 80,
    "enable_language_server": true,
    "ensure_final_newline_on_save": true,
    "remove_trailing_whitespace_on_save": true,
    "default_dock_anchor": "right",
    "formatter": "language_server",
    "lsp": {
        "rust-analyzer": {
            "initialization_options": {
                "check": {
                    "command": "clippy" // rust-analyzer.check.command (default: "check")
                }
            }
        }
    },
    "inlay_hints": {
        "enabled": true
    },
    "prettier": {
        "allowed": true
    },
    "proxy": "http://localhost:2080",
    // LXGW WenKai Screen
    // "ui_font_family": "Comic Mono",
    // "editor.fontFamily": "'Comic Mono', 'LXGW WenKai Screen'",
    // "terminal.integrated.fontFamily": "ComicShannsMono Nerd Font Mono",
    "tab_size": 4,
    "vim": {
        "use_system_clipboard": "always"
    },
    "autosave": "on_focus_change",
    "theme": {
        "mode": "system",
        // "light": "Rosé Pine Dawn",
        "light": "One Light",
        "dark": "One Dark"
    },
}
bersace commented 1 month ago

Do you have a shortcut base on ctrl-w ? Does Zed have a keymap viewer ?

l-7-l commented 1 month ago

@bersace No, I don't have a ctrl-w based shortcut, there also nothing in keymap.json

CharlesChen0823 commented 1 month ago

might "vim_mode": "true" cause this problem.

apricotbucket28 commented 1 month ago

Could this be related to https://github.com/zed-industries/zed/issues/11089#issuecomment-2212491830?

l-7-l commented 1 month ago

Could this be related to #11089 (comment)? I'm not sure, but turning off vim-mode does make the problem go away. However, in the vim default keymap, the binding for ctrl-w is null. If the key combination matches None, it should stop searching and hand it over to the next plugin.

might "vim_mode": "true" cause this problem.

yes

l-7-l commented 1 month ago

Could this be related to #11089 (comment)?

looks more like this As far as I know if you configure and x it slows down , usually a 1 second delay to determine what keystrokes you end up with

ralphpig commented 1 month ago

I just added a binding to close the pane on double tap ctrl-w. Good enough for me right now

{
    "context": "Editor",
    "bindings": {
      "ctrl-w ctrl-w": "pane::CloseActiveItem"
    }
}
asborisov commented 1 month ago

I can confirm the reason. I never use "cmd-w {something}" so I just dropped those from keymap.json and no closing is fast again