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

[Bug] Replace starts from the end of the currently selected text #49

Closed
AmionSky opened this issue Jul 12, 2019 · 4 comments
Closed

[Bug] Replace starts from the end of the currently selected text #49

AmionSky opened this issue Jul 12, 2019 · 4 comments

Comments

@AmionSky
Copy link
Contributor

AmionSky commented Jul 12, 2019

When you use 'Find' it selects the text that matches.
When you use 'Replace' it seems to start from the end of the currently selected text.

But it does not allow to use search to quicly find the exact place you were looking for and then just press replace, since it will try to find the next match to replace.

Notepad replaces the currently selected text.

@AmionSky
Copy link
Contributor Author

Also 'Find' cycles back to the beginning, 'Replace' does not. (Unsure if its intended)

@AmionSky
Copy link
Contributor Author

When pressing replace in Notepad, it always just selects the first match. Pressing replace again replaces it and moves the selection to the next match. Both VS and vscode seems to work the same way.

@0x7c13
Copy link
Owner

0x7c13 commented Jul 13, 2019

Replace stops because it should gives user more control of what will be replaced. The idea of starting from selected index is also the same: It gives user fine control on what should be replaced. For example, you may only want to replace certain text in the last 20 lines of the file. In this case, it should not starts from first line and it should not do cycles as well. "Replace All" is a different story, so it starts from zero and actually replace all occurrence.

@0x7c13
Copy link
Owner

0x7c13 commented Apr 17, 2020

Closing this thread since this is an indented behavior.

@0x7c13 0x7c13 closed this as completed Apr 17, 2020
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

2 participants