zed
zed copied to clipboard
Vim mode: Difficulties attempting to rename a symbol
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
Hello! When attempting to rename a symbol using the editor: rename
command in vim mode, regular keystrokes seem to randomly cancel the operation.
Screencast_from_2024-05-15_11-56-22.webm
In this video, trying to type a character into the entry will cause it to exit and return to the editor.
Thank you!
Environment
Zed: v0.136.0 (Zed Preview)
OS: Linux 1.0.0
Memory: 31.1 GiB
Architecture: x86_64
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.
No response
I found in Insert
mode will be easy rename, but in Normal
mode, need first type i
to Insert
mode, then will work.
This doesn't seem to be broken for me (though we did recently make some changes in this area).
Are there specific keystrokes or contexts that cause this for you?
@CharlesChen0823 That works! A little jank though
@ConradIrwin Hey, this problem happens at random from what I can tell, unless you press i
first, as Charles noted. However, I'm on linux, Gnome 46 with the Jetbrains base keymap, if that is helpful. Can you replicate it now?
Thank you both!
This doesn't seem to be broken for me (though we did recently make some changes in this area).
Are there specific keystrokes or contexts that cause this for you?
hi,When I found this issues I tried it and it also reproduced, but it was only a one time reproduction and later it was normal again, unknown cause
Zed: v0.136.0 (Zed Preview)
OS: macOS 14.4.1
Memory: 32 GiB
Architecture: aarch64
It seems that the problem is that if you're in normal mode, and then try to rename a symbol, it will give you the illusion of being in insert mode (e.g. the cursor style), even though you aren't. I'd suggest that renaming a symbol should always bring you into insert mode, and when done renaming, you should be put back into whatever mode you've been in before.
@msanft are you on Mac or linux? Although I don't know why there would be a difference, it does seem like there is.
@msanft are you on Mac or linux? Although I don't know why there would be a difference, it does seem like there is.
I'm on Linux
I found that remapping this in my vim keymap has made this very stable. Triggering this rename manually through the command pallete had the issues described above.
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
// put key-bindings here if you want them to work in normal & visual mode
"R": "editor::Rename"
}
}
Using a keymap, I can hit R
and then immediately start typing with expected behavior. I am even returned to normal mode after hitting enter
This is now in today's preview release.