Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Fix ReplacedOcc translation crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Mar 25, 2020
1 parent cbf583d commit af2bb29
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions UI/MainWindowFindReplaceHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,17 @@ private void ReplaceAll()
Regex regex = GetSearchRegex();
if (regex == null) { return; }

int count = 0;
int fileCount = 0;

string replaceString = ReplaceBox.Text;
foreach (var editor in editors)
{
MatchCollection mc = regex.Matches(editor.editor.Text);
if (mc.Count > 0)
{
fileCount++;
count += mc.Count;
editor.editor.BeginChange();
for (int j = mc.Count - 1; j >= 0; --j)
{
Expand All @@ -257,8 +262,8 @@ private void ReplaceAll()
editor.NeedsSave = true;
}
}
//FindResultBlock.Text = "Replaced " + count.ToString() + " occurences in " + fileCount.ToString() + " documents";
FindResultBlock.Text = string.Format(Program.Translations.GetLanguage("ReplacedOcc, count, fileCount"));
// FindResultBlock.Text = "Replaced " + count.ToString() + " occurences in " + fileCount.ToString() + " documents";
FindResultBlock.Text = string.Format(Program.Translations.GetLanguage("ReplacedOcc"), count, fileCount);
}

private void Count()
Expand Down

0 comments on commit af2bb29

Please sign in to comment.