Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default for replace should be non-regex #2937

Open
gdevenyi opened this issue Sep 26, 2023 · 7 comments
Open

Default for replace should be non-regex #2937

gdevenyi opened this issue Sep 26, 2023 · 7 comments

Comments

@gdevenyi
Copy link

The default search and replace is regex, which is opposite to most editors.

A quick search through the issues reveals users regularly run into this and have no idea why their replace doesn't work.

@dustdfg
Copy link
Contributor

dustdfg commented Mar 17, 2024

@dmaluka @JoeKar for close?

I only have one doubt. The PR of @dmaluka changes search from ctrl+f and not use alt+shift+f so why?

399134f

@JoeKar
Copy link
Collaborator

JoeKar commented Mar 17, 2024

Are you referring to the change done in find(useRegex bool) which is used by Find(true) and FindLiteral(false)? Because changing it in the common one will fave impact to the one calling with useRegex set to true.
In case of main( will be converted to main\( in case of useRegex set to true, otherwise remains main(.

I tried it with CTRL+F and ALT+SHIFT+F and it worked.

@dustdfg
Copy link
Contributor

dustdfg commented Mar 17, 2024

Are you referring to the change done in find(useRegex bool) which is used by Find(true) and FindLiteral(false)? Because changing it in the common one will fave impact to the one calling with useRegex set to true. In case of main( will be converted to main\( in case of useRegex set to true, otherwise remains main(.

I tried it with CTRL+F and ALT+SHIFT+F and it worked.

Ah ok. I am just a fool and thought there are two different function but now I see it is one... Issue can be closed

@JoeKar
Copy link
Collaborator

JoeKar commented Mar 17, 2024

Issue can be closed

I'm unsure if we really can.
The request was to change the default replace mechanism from regex to literal. I've become careful in the moment we change already known/defined defaults, because there will be someone complaining at the end about this change.

@dmaluka:
What do you mean? At least we've key bindings to use for a dedicated search&replace mechanism. Changing the default of replace(all) will definitely cause trouble with the power users. 😉

@dmaluka
Copy link
Collaborator

dmaluka commented Mar 17, 2024

I don't think we should change the defaults.

Regarding keybindings, I don't think we currently have any keybindings for replace. It would be probably a good idea to add some.

@gdevenyi
Copy link
Author

Is the target audience of this micron a power user or a starting user? The answer to this determines the default value for search.

#2963 encapsulates the way search should be as the default experience.

@JoeKar
Copy link
Collaborator

JoeKar commented Mar 18, 2024

Regarding keybindings, I don't think we currently have any keybindings for replace.

I mixed that up with the bindings for find. But as you already realized too, maybe this will help to give the user the capability to decide which mode to use by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants