eclipse.platform.ui icon indicating copy to clipboard operation
eclipse.platform.ui copied to clipboard

Find/Replace overlay: remember parameters from earlier

Open Wittmaxi opened this issue 1 year ago • 1 comments

store search options and load on opening - also helps synchronise search options between different editors

Wittmaxi avatar Jul 08 '24 11:07 Wittmaxi

In my opinion, we should consider implementing this in a similiar way than VS code does: it shares the search options for the current stack of editors but allows to have different options for multiple stacks of editors. search_settings_vscode

I see the following scenarios, which are perfectly covered by that solution:

  • You want to search for some string with specific settings in different files, one after another. Then you can simply enter the string once and configure the settings once and navigate through the files (one after another in the same stack) while always having the same options. This also reflects a use case that was well supported by the existing find/replace dialog (and is currently unsupported by the overlay), where you want to apply the same search to multiple files.
  • You want to do some side-by-side search for different strings with different settings, maybe comparing these two or even perform them (content-wise) independent from each other but still (time-wise) concurrently. Then you can open two editor stacks, each having the according search string and search options set.

I would prefer this over having totally global settings (only supporting the first case) because of the second scenario: I want to be able to perform different searches "at the same time" for different files. With the existing find/replace dialog, I have to switch the options over and over again.

In my opinion, this also reflects a natural expectation: if I have two editors open side-by-side, I do not expect the search dialog of one of them to influcene the other, as they are visually different, independent instances. At the same time, navigating through an editor stack, the find/replace overlay is visually the same for all these editors, as it is placed at the same position, so I might also expect it to always contain the same information when it appears there.

That's why I propose to revise #2058 to not simply have a global state, but one that depends on the editor stack (if that's possible).

Would be great to have more opinions on this. So what do others think?

HeikoKlare avatar Aug 23 '24 15:08 HeikoKlare