Fix adhere to max number of lines - thx Andrebavila :)

Fix #5107
This commit is contained in:
Nikolaj Olsson 2021-06-06 17:20:19 +02:00
parent 45467c497f
commit f0688308b8

View File

@ -9793,7 +9793,7 @@ namespace Nikse.SubtitleEdit.Forms
int numberOfLines = Utilities.GetNumberOfLines(textBoxListViewText.Text); int numberOfLines = Utilities.GetNumberOfLines(textBoxListViewText.Text);
if (e.Modifiers == Keys.None && e.KeyCode == Keys.Enter && numberOfLines > Configuration.Settings.General.MaxNumberOfLines) if (e.Modifiers == Keys.None && e.KeyCode == Keys.Enter && numberOfLines >= Configuration.Settings.General.MaxNumberOfLines)
{ {
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }
@ -25581,7 +25581,7 @@ namespace Nikse.SubtitleEdit.Forms
int numberOfLines = Utilities.GetNumberOfLines(textBoxListViewTextOriginal.Text); int numberOfLines = Utilities.GetNumberOfLines(textBoxListViewTextOriginal.Text);
if (e.Modifiers == Keys.None && e.KeyCode == Keys.Enter && numberOfLines > Configuration.Settings.General.MaxNumberOfLines) if (e.Modifiers == Keys.None && e.KeyCode == Keys.Enter && numberOfLines >= Configuration.Settings.General.MaxNumberOfLines)
{ {
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
} }