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

Replace : match destination casing #977

Open
meteorquake opened this issue Feb 17, 2025 · 2 comments
Open

Replace : match destination casing #977

meteorquake opened this issue Feb 17, 2025 · 2 comments

Comments

@meteorquake
Copy link

meteorquake commented Feb 17, 2025

It would be helpful if the Replace dialog had an option to adjust the casing of the replacement text to the destination.
So in
"This and this and THIS"
a replacement of this -> that would yield
"That and that and THAT"
I suspect this would actually be the normal requirement for all replacements (where Match Case is not ticked, where it is ticked there will naturally be no adjustments occurring anyway) so it's quite possible this could be done as a general option defaulting to on. That said, people can be lazy to put case matching on for a replacement they know is unique where it should strictly be used so I suspect it would arguably best be an option in the Replace dialog itself.
Cheers, David

@zufuliu
Copy link
Owner

zufuliu commented Feb 17, 2025

What if the replacement string has different length? it's easy to construct replacement string (from search string) in editor window with existing case mapping menus.

@meteorquake
Copy link
Author

meteorquake commented Feb 17, 2025

I should clarify there, that in this concept the length doesn't matter. Basically -

  • found word is all upper case then replacement becomes all upper case
  • found word has just first letter capitalised, the replacement has first letter capitalised
  • found word all lower case, the replacement is all lower case
  • found word is some weird combination of casing which is unlikely then it could probably go in unaltered

The above applies when the replacement string is all lower case; if the replacement string has any upper casing, it does a straightforward replacement without regard to the target casing found...

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