zed icon indicating copy to clipboard operation
zed copied to clipboard

Prevent editor focus after find and replace operations

Open photex opened this issue 9 months ago • 1 comments

Release Notes:

  • Fix an inconsistent behavior in the buffer "find and replace" UI where focus would be given to the editor after a replacement is made.

When using the find and replace bar in an editor, using only the 'find' operation maintains the focus on the search bar after hitting enter to activate the next match in the editor buffer. But when using replace the editor received focus and surprisingly the next time you hit enter, the match is replaced with a newline in the editor instead of replacing the next match.

I doubt this one line is sufficient to cover every case, but when I built and tested Zed this fixed the problem in the couple of cases where I ran into the problem.

I haven't added any tests yet. This PR can be closed while someone else hops on board with the task, otherwise I'm happy to move along with some suggestions.

photex avatar May 16 '25 04:05 photex

Warnings
:warning:

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by :no_entry_sign: dangerJS against e94818d76db29343dc7ebed97d82bb45fd8d3a46

zed-industries-bot avatar May 16 '25 05:05 zed-industries-bot

Sorry again for overlooking, superseded by https://github.com/zed-industries/zed/pull/30890

SomeoneToIgnore avatar May 29 '25 07:05 SomeoneToIgnore