Keep the old active line when an automation script changes the selection but not active line
This commit is contained in:
parent
162e119afa
commit
d07cba4875
1 changed files with 2 additions and 2 deletions
|
@ -910,14 +910,14 @@ namespace Automation4 {
|
|||
auto lines = subsobj->ProcessingComplete(StrDisplay(c));
|
||||
|
||||
AssDialogue *active_line = nullptr;
|
||||
int active_idx = 0;
|
||||
int active_idx = original_active;
|
||||
|
||||
// Check for a new active row
|
||||
if (lua_isnumber(L, -1)) {
|
||||
active_idx = lua_tointeger(L, -1);
|
||||
if (active_idx < 1 || active_idx > (int)lines.size()) {
|
||||
wxLogError("Active row %d is out of bounds (must be 1-%u)", active_idx, lines.size());
|
||||
active_idx = 0;
|
||||
active_idx = original_active;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue