This commit is contained in:
Nikolaj Olsson 2018-04-05 20:30:56 +02:00
parent 263e14316c
commit d3191add9e
2 changed files with 11 additions and 17 deletions

View File

@ -5270,26 +5270,17 @@ namespace Nikse.SubtitleEdit.Forms
if (replace)
{
var tb = GetFindRepaceTextBox();
if (_findHelper.MatchInOriginal)
tb.SelectionStart = _findHelper.SelectedPosition;
tb.SelectionLength = _findHelper.FindTextLength;
if (_findHelper.FindReplaceType.FindType == FindType.RegEx)
{
textBoxListViewTextAlternate.SelectionStart = _findHelper.SelectedPosition;
textBoxListViewTextAlternate.SelectionLength = _findHelper.FindTextLength;
textBoxListViewTextAlternate.SelectedText = _findHelper.ReplaceText;
ReplaceViaRegularExpression(tb, replaceAll);
_findHelper.SelectedPosition += _findHelper.FindTextLength;
}
else
{
tb.SelectionStart = _findHelper.SelectedPosition;
tb.SelectionLength = _findHelper.FindTextLength;
if (_findHelper.FindReplaceType.FindType == FindType.RegEx)
{
ReplaceViaRegularExpression(tb, replaceAll);
_findHelper.SelectedPosition += _findHelper.FindTextLength;
}
else
{
tb.SelectedText = _findHelper.ReplaceText;
_findHelper.SelectedPosition += _findHelper.ReplaceText.Length;
}
tb.SelectedText = _findHelper.ReplaceText;
_findHelper.SelectedPosition += _findHelper.ReplaceText.Length;
}
}
}
@ -7657,6 +7648,8 @@ namespace Nikse.SubtitleEdit.Forms
_listViewTextUndoIndex = -1;
SubtitleListView1SelectedIndexChange();
if (_findHelper != null)
_findHelper.MatchInOriginal = false;
}
private void ShowLineInformationListView()

View File

@ -140,7 +140,8 @@ namespace Nikse.SubtitleEdit.Logic
}
position = 0;
}
MatchInOriginal = false;
if (index < subtitle.Paragraphs.Count -1)
MatchInOriginal = false;
if (originalSubtitle != null && allowEditOfOriginalSubtitle)
{