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

Commit af2bb29

Browse files
committed
Fix ReplacedOcc translation crash
1 parent cbf583d commit af2bb29

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

UI/MainWindowFindReplaceHandler.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,17 @@ private void ReplaceAll()
241241
Regex regex = GetSearchRegex();
242242
if (regex == null) { return; }
243243

244+
int count = 0;
245+
int fileCount = 0;
246+
244247
string replaceString = ReplaceBox.Text;
245248
foreach (var editor in editors)
246249
{
247250
MatchCollection mc = regex.Matches(editor.editor.Text);
248251
if (mc.Count > 0)
249252
{
253+
fileCount++;
254+
count += mc.Count;
250255
editor.editor.BeginChange();
251256
for (int j = mc.Count - 1; j >= 0; --j)
252257
{
@@ -257,8 +262,8 @@ private void ReplaceAll()
257262
editor.NeedsSave = true;
258263
}
259264
}
260-
//FindResultBlock.Text = "Replaced " + count.ToString() + " occurences in " + fileCount.ToString() + " documents";
261-
FindResultBlock.Text = string.Format(Program.Translations.GetLanguage("ReplacedOcc, count, fileCount"));
265+
// FindResultBlock.Text = "Replaced " + count.ToString() + " occurences in " + fileCount.ToString() + " documents";
266+
FindResultBlock.Text = string.Format(Program.Translations.GetLanguage("ReplacedOcc"), count, fileCount);
262267
}
263268

264269
private void Count()

0 commit comments

Comments
 (0)