From 043428d153be85113b3705f5d84e49e9c7309c7c Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Sat, 1 Feb 2014 20:27:41 -0800
Subject: [PATCH] Set extendRow even when active_line doesn't change

After shift-clicking on the grid the row to extend from doesn't equal
the active line, and clicking on the current active line to deselect all
other lines need to update the extend row.
---
 aegisub/src/base_grid.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/aegisub/src/base_grid.cpp b/aegisub/src/base_grid.cpp
index 4675ad585..377552b02 100644
--- a/aegisub/src/base_grid.cpp
+++ b/aegisub/src/base_grid.cpp
@@ -1036,8 +1036,10 @@ void BaseGrid::SetActiveLine(AssDialogue *new_line) {
 		AnnounceActiveLineChanged(active_line);
 		MakeRowVisible(GetDialogueIndex(active_line));
 		Refresh(false);
-		extendRow = GetDialogueIndex(new_line);
 	}
+	// extendRow may not equal the active row if it was set via a shift-click,
+	// so update it even if the active line didn't change
+	extendRow = GetDialogueIndex(new_line);
 }
 
 void BaseGrid::SetSelectionAndActive(Selection const& new_selection, AssDialogue *new_line) {
-- 
GitLab