From db527e49857ec4aa8a06cbee7863730cf683004d Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sat, 17 Aug 2024 15:25:32 +0200 Subject: [PATCH] Only auto-br if total "merge length" exceeds max line length - thx Llorx :) Try to fix #8741 --- src/ui/Forms/Main.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 8593b976f..22e2a2ded 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -13218,8 +13218,17 @@ namespace Nikse.SubtitleEdit.Forms } else { - currentParagraph.Text = (currentParagraph.Text.Trim() + Environment.NewLine + - RemoveAssStartAlignmentTag(nextParagraph.Text).Trim()).Trim(); + var text = (currentParagraph.Text.Trim() + Environment.NewLine + + RemoveAssStartAlignmentTag(nextParagraph.Text).Trim()).Trim(); + var oneLine = Utilities.UnbreakLine(text); + if (oneLine.Length <= Configuration.Settings.General.SubtitleLineMaximumLength) + { + currentParagraph.Text = oneLine; + } + else + { + currentParagraph.Text = text; + } } currentParagraph.Text = FixAssaTagsAfterMerge(currentParagraph.Text);