Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
add Quick Action: Remove Dash From First Line Of Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalsol committed May 19, 2024
1 parent 23d8448 commit 8f401e5
Show file tree
Hide file tree
Showing 3 changed files with 312 additions and 66 deletions.
132 changes: 66 additions & 66 deletions SubtitlesCleaner.Editor/QuickActionsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions SubtitlesCleaner.Editor/SubtitlesCleanerEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,7 @@ private void QuickActions()
,new QuickAction("Fix I And 1 Errors", "I6 => 16 1 can => I can", FixIAnd1Errors)
,new QuickAction("Merge Lines", "Hi,|How are you? => Hi, How are you?", MergeLines)
,new QuickAction("Remove Single Quotation Marks", "'Text Line' => Text Line", RemoveSingleQuotationMarks)
,new QuickAction("Remove Dash From First Line Of Dialog", "- Dialog|Continuation => Dialog|Continuation", RemoveDashFromFirstLineOfDialog)
};

List<Subtitle> newSubtitles = subtitles.Clone();
Expand Down Expand Up @@ -2382,6 +2383,19 @@ private QuickActionResult RemoveSingleQuotationMarks(List<Subtitle> subtitles, b
);
}

private QuickActionResult RemoveDashFromFirstLineOfDialog(List<Subtitle> subtitles, bool isPreview)
{
return QuickActionFindAndReplace(
subtitles,
new QuickActionCleanHandler[] {
SubtitlesHelper.RemoveDashFromFirstLineOfDialog
},
null,
null,
isPreview
);
}

private QuickActionResult QuickActionFindAndReplace(
List<Subtitle> subtitles,
SubtitlesCleaner.Library.FindAndReplace[] rules,
Expand Down
Loading

0 comments on commit 8f401e5

Please sign in to comment.