forked from mia/Aegisub
Fix splitting lines by karaoke
New lines have to be committed before they can be selected. Closes #1541.
This commit is contained in:
parent
31803fd961
commit
5c2d31d6db
1 changed files with 6 additions and 3 deletions
|
@ -317,13 +317,16 @@ void AssKaraoke::SplitLines(std::set<AssDialogue*> const& lines, agi::Context *c
|
||||||
sel.erase(diag);
|
sel.erase(diag);
|
||||||
delete diag;
|
delete diag;
|
||||||
--it;
|
--it;
|
||||||
|
|
||||||
|
did_split = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!did_split) return;
|
||||||
|
|
||||||
|
c->ass->Commit(_("splitting"), AssFile::COMMIT_DIAG_ADDREM | AssFile::COMMIT_DIAG_FULL);
|
||||||
|
|
||||||
AssDialogue *new_active = c->selectionController->GetActiveLine();
|
AssDialogue *new_active = c->selectionController->GetActiveLine();
|
||||||
if (!sel.count(c->selectionController->GetActiveLine()))
|
if (!sel.count(c->selectionController->GetActiveLine()))
|
||||||
new_active = *sel.begin();
|
new_active = *sel.begin();
|
||||||
c->selectionController->SetSelectionAndActive(sel, new_active);
|
c->selectionController->SetSelectionAndActive(sel, new_active);
|
||||||
|
|
||||||
if (did_split)
|
|
||||||
c->ass->Commit(_("splitting"), AssFile::COMMIT_DIAG_ADDREM | AssFile::COMMIT_DIAG_FULL);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue