Skip to content

Fix Replace selection handling and no-match feedback - #42

Open
HaruLerrz wants to merge 1 commit into
forloopcodes:mainfrom
HaruLerrz:pr-fix-replace-behavior
Open

Fix Replace selection handling and no-match feedback#42
HaruLerrz wants to merge 1 commit into
forloopcodes:mainfrom
HaruLerrz:pr-fix-replace-behavior

Conversation

@HaruLerrz

Copy link
Copy Markdown

This fixes two issues in the Replace dialog.

Changes:

  • Uses RichEdit's EM_GETSELTEXT to read the current selection before replacing it, instead of using RichEdit selection positions as indices into a separate std::wstring.
  • Shows the existing "Cannot find" message when Replace All finds zero matches.

The Find implementation itself is unchanged by this PR.

Tested locally with:

  • manually selecting a matching string and replacing it successfully
  • Replace All with multiple matches
  • Replace All with zero matches showing the existing "Cannot find" message

Subsequent Find behavior after a replacement is unchanged and is covered separately by #38.

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

Successfully merging this pull request may close these issues.

1 participant