zed icon indicating copy to clipboard operation
zed copied to clipboard

project replace feature will replace what was last found instead of what is in the field

Open derek-v-s opened this issue 11 months ago • 1 comments

Summary

In the project search window:

  1. search for test01a
  2. switch search field to test01b
  3. press the replace all button

test01a will be replaced.

Zed Version and System Specs

Zed: v0.186.6 (Zed Preview) OS: Linux X11 ubuntu 24.04 Memory: 7.7 GiB Architecture: x86_64 GPU: NVIDIA GeForce GTX 1050 Ti || NVIDIA || 550.144.03

derek-v-s avatar May 10 '25 20:05 derek-v-s

This probably isn't technically a "bug". But it's something to consider.

One thought is disabling replace if the search field has changed, and then re-enabling it after a search has been run.

derek-v-s avatar May 10 '25 20:05 derek-v-s

Just hit this. Immensely confusing behavior. Just checking what VSCode does here, is that they always re-search on change in the search input (rather than waiting for a submit action from the user). That way the UI is always in sync. Disabling the replace (when results and search value are out of sync) would at least protect users for now.

djrenren avatar May 21 '25 18:05 djrenren

Closing in favor of:

  • https://github.com/zed-industries/zed/issues/34897

notpeter avatar Aug 18 '25 16:08 notpeter