From 07f0c9cb116cb9eb321c2d7872071e23ee7a99ff Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 4 Nov 2019 19:21:43 +0100 Subject: [PATCH] Try to fix Replace issue - thx loyaldragon :) --- src/Forms/Main.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs index b882b89a6..ff0f6abf9 100644 --- a/src/Forms/Main.cs +++ b/src/Forms/Main.cs @@ -5467,6 +5467,7 @@ namespace Nikse.SubtitleEdit.Forms { tb.SelectedText = _findHelper.ReplaceText; msg = _language.OneReplacementMade + " "; + _findHelper.SelectedPosition += _findHelper.ReplaceText.Length; } if (_findHelper.FindNext(_subtitle, _subtitleAlternate, _findHelper.SelectedIndex, _findHelper.SelectedPosition, Configuration.Settings.General.AllowEditOfOriginalSubtitle)) @@ -5513,18 +5514,25 @@ namespace Nikse.SubtitleEdit.Forms if (replaceDialog != null && !replaceDialog.IsDisposed) { replaceDialog.Dispose(); - replaceDialog = null; } _findHelper.InProgress = false; return; } } + else + { + if (replaceDialog != null && !replaceDialog.IsDisposed) + { + replaceDialog.Dispose(); + } + _findHelper.InProgress = false; + return; + } } Replace(replaceDialog); if (replaceDialog != null && !replaceDialog.IsDisposed) { replaceDialog.Dispose(); - replaceDialog = null; } _findHelper.InProgress = false; return;