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

Find and Replace dialog fixes #274

Merged

Conversation

pstranak-sw
Copy link
Contributor

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

@@ -494,10 +494,6 @@ private void InitializeComponent()
this.aboutSWQLStudioToolStripMenuItem.Text = "About SWQL Studio";
this.aboutSWQLStudioToolStripMenuItem.Click += new System.EventHandler(this.aboutSWQLStudioToolStripMenuItem_Click);
//
// 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.

@@ -1080,7 +1073,7 @@ private CharacterRange ReplaceNext(bool searchUp)
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.

None yet

2 participants