mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Fix freeze in spell check change all - thx Edwin :)
This commit is contained in:
parent
5db72ae5c5
commit
42d5320cd5
@ -6657,7 +6657,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
int end = startIndex + oldWord.Length;
|
||||
if (end <= p.Text.Length && end == p.Text.Length || ("«»“” ,.!?:;'()<>\"-—+/[]{}%&$£…\r\n؛،؟").Contains(p.Text[end]))
|
||||
{
|
||||
var lengthBefore = p.Text.Length;
|
||||
p.Text = p.Text.Remove(startIndex, oldWord.Length).Insert(startIndex, changeWord);
|
||||
var lengthAfter = p.Text.Length;
|
||||
if (lengthAfter > lengthBefore)
|
||||
{
|
||||
startIndex += (lengthAfter - lengthBefore);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (startIndex + 2 >= p.Text.Length)
|
||||
|
Loading…
Reference in New Issue
Block a user