Skip to content

Find and Replace dialog fixes#274

Merged
tdanner merged 8 commits intosolarwinds:masterfrom
pstranak-sw:bugfix/searchReplaceDialogFixes
Mar 22, 2021
Merged

Find and Replace dialog fixes#274
tdanner merged 8 commits intosolarwinds:masterfrom
pstranak-sw:bugfix/searchReplaceDialogFixes

Conversation

@pstranak-sw
Copy link
Contributor

A bunch of fixes for issues in the "Find and Replace" dialog. One commit per issue.

//
// openFileDialog
//
this.openFileDialog.FileName = "openFileDialog1";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to the "Find and Replace" dialog, but why not fix it anyway.

if (rdoRegexR.Checked)
{
rr = new Regex(txtFindR.Text, GetRegexOptions());
string selRangeText = Scintilla.GetTextRange(selRange.cpMin, selRange.cpMax - selRange.cpMin + 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of bad replace:

  • query: abc
  • search for regex: b
  • replace with: d
  • result was: adcc

@pstranak-sw
Copy link
Contributor Author

The dialog contains surprisingly lot of duplicated or unfinished code and copy-paste issues. This PR should fix the ones I encountered.

What are the plans for the whole "ScintillaNET-FindReplaceDialog" component? Do only as few changes as possible? Delete everything we don't use (IncrementalSearch, FindAllResults, GoTo)? Refactor the code we use to simplify it?

Are changes like this even OK, considering it's a 3rd-party code?

@pstranak-sw
Copy link
Contributor Author

Changes are available for testing in build 3.0.0.312

Copy link
Contributor

@tdanner tdanner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up. Since we have copied this code into this project (can't remember who added this feature), we should fix problems like this.

@tdanner tdanner merged commit 97e5ffe into solarwinds:master Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants