Minor improvements for spell check

This commit is contained in:
niksedk 2014-06-19 21:14:08 +02:00
parent 097ec3f178
commit f439be0fa3

View File

@ -224,11 +224,19 @@ namespace Nikse.SubtitleEdit.Forms
Utilities.ShowHelp("#spellcheck");
e.SuppressKeyPress = true;
}
if (e.Modifiers == Keys.Control && e.KeyCode == Keys.G)
else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.G)
{
e.SuppressKeyPress = true;
System.Diagnostics.Process.Start("http://www.google.com/search?q=" + Utilities.UrlEncode(textBoxWord.Text));
}
else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Z)
{
if (buttonUndo.Visible)
{
buttonUndo_Click(null, null);
e.SuppressKeyPress = true;
}
}
}
private void ButtonAbortClick(object sender, EventArgs e)
@ -911,9 +919,9 @@ namespace Nikse.SubtitleEdit.Forms
{
found = true;
int endIndexPlus = indexStart + wordWithDashesOrPeriods.Length;
bool startOk = indexStart == 0 || (" ['\"" + Environment.NewLine).Contains(text.Substring(indexStart - 1, 1));
bool startOk = indexStart == 0 || (" (['\"" + Environment.NewLine).Contains(text.Substring(indexStart - 1, 1));
bool endOk = endIndexPlus == text.Length;
if (!endOk && endIndexPlus < text.Length && (",!?:;. ]").Contains(text.Substring(endIndexPlus, 1)))
if (!endOk && endIndexPlus < text.Length && (",!?:;. ])<'\"").Contains(text.Substring(endIndexPlus, 1)))
endOk = true;
if (startOk && endOk)
{