From d07cba4875ed3de2440085b50ef2c952a14fa192 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 16 Apr 2014 08:04:20 -0700 Subject: [PATCH] Keep the old active line when an automation script changes the selection but not active line --- src/auto4_lua.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auto4_lua.cpp b/src/auto4_lua.cpp index ac46108d0..194c110dc 100644 --- a/src/auto4_lua.cpp +++ b/src/auto4_lua.cpp @@ -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; } }