Open shinebayar-g opened 9 months ago
Hey @shinebayar-g! I cannot reproduce this. When I search in the buffer and the search input is focused, enter
gets me to the next search result.
See here: https://github.com/zed-industries/zed/assets/1185253/ec3eb75e-0464-43bd-b52f-03f4b6b330ca
Or do you use Vim mode by any chance?
Or do you use Vim mode by any chance?
The enable vim-mode same will enter new lines
Or do you use Vim mode by any chance?
Hey @mrnugget , thanks for the hint. I noticed that It's only reproducible in Vim mode.
Okay, I see. But where does this expectation come from? As far as I know (and I just checked again): by default Vim doesn't bind <enter>
to go-to-next-search-result. It's bound to n
and <cr>
is equivalent to ctrl-m
.
yeah 😞
Okay, I see. But where does this expectation come from? As far as I know (and I just checked again): by default Vim doesn't bind
<enter>
to go-to-next-search-result. It's bound ton
and<cr>
is equivalent toctrl-m
.
And. The shift-enter
useful in vim-mode (prev-result)? If so, it would be more intuitive to bind enter to the search input(box)
I still can't reproduce this. When I search in Vim mode with /
and then hit <enter>
I only jump the next line, just like in Vim.
https://github.com/zed-industries/zed/assets/1185253/b30ef37c-70ac-485a-a7a5-32353dc01dfd
I still can't reproduce this. When I search in Vim mode with
/
and then hit<enter>
I only jump the next line, just like in Vim. screenshot-2024-02-13-16.49.37.mp4
You beat me to it 😄 . Try the same when you're in INSERT mode.
I still can't reproduce this. When I search in Vim mode with
/
and then hit<enter>
I only jump the next line, just like in Vim.screenshot-2024-02-13-16.49.37.mp4
Disable all my custom keymap and use "/" + "cmd+shift+f" <enter>
not work
vim-mode "n" / "shift-n" prev/next result it work
Okay, so you want to work like in non-vim-mode when you trigger a search through cmd+f
/cmd-shift-f
even though you're in Vim mode, yes?
Yeah I would be glad if certain base functionalities work the same across vim/non-vim modes.. Like search.
I think that when the search-input is focused, triggering enter
should trigger an operation (such as next-result), rather than unfocus and jump to the result. This is not in line with the habits we have developed using other applications.
I think that when the search-input is focused, triggering
enter
should trigger an operation (such as next-result), rather than unfocus and jump to the result. This is not in line with the habits we have developed using other applications.
I personally prefer that, because it's exactly how it works in Vim: you start a search with /
, you finish it by hitting enter
, you jump to the next search results with n
/N
. That's at least the habit I've developed over a decade of using Vim :)
But I think the solution here would be to change the behaviour depending on whether the search was started via cmd-f
or via /
.
I'm just wondering why 'shift enter' works. Is this bug?
The default bind
This is what I wanted to say. There is a difference between searching in NORMAL vs INSERT mode. NORMAL mode works as expected. return key jumps to the next result. In INSERT mode it doesn't. It inserts new line instead.
https://github.com/zed-industries/zed/assets/3091558/efba782a-5c60-416d-bd18-ce063181beb3
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in a week. Feel free to open a new issue if you're seeing this message after the issue has been closed. Thanks for your help!
Still an issue
Can this issue be re-evaluated? Without enter working, ctrl+f is kind of useless. Whenever I press enter it just moves cursor to the next line instead of jumping to the next match.
Clicking n
to navigate to the next match works only if the find bar is not in focus. If the find bar is still in focus it adds n
to the search input. So UX around is not so great.
Check for existing issues
Describe the bug / provide steps to reproduce it
When searching for text, search window should loop through the results when ENTER key is pressed and shouldn't do anything except maybe beep sound for no result.
Currently when I press ENTER key it edits the code and adds new line.
Environment
Zed: v0.122.2 (Zed Preview) OS: macOS 14.3.1 Memory: 16 GiB Architecture: aarch64
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.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.No response