From 0140131446ed648a76559531bb8bd16a5d7250be Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Sun, 16 Nov 2014 13:25:17 -0800
Subject: [PATCH] Update the selection and scroll position after opening
 subtitles from video

---
 src/command/subtitle.cpp | 2 +-
 src/project.cpp          | 4 ++--
 src/project.h            | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/command/subtitle.cpp b/src/command/subtitle.cpp
index 02bc640cf..1edacb000 100644
--- a/src/command/subtitle.cpp
+++ b/src/command/subtitle.cpp
@@ -286,7 +286,7 @@ struct subtitle_open_video final : public Command {
 
 	void operator()(agi::Context *c) override {
 		if (c->subsController->TryToClose() == wxCANCEL) return;
-		c->subsController->Load(c->project->VideoName(), "binary");
+		c->project->LoadSubtitles(c->project->VideoName(), "binary", false);
 	}
 
 	bool Validate(const agi::Context *c) override {
diff --git a/src/project.cpp b/src/project.cpp
index 21bfe23ce..2d1a404a7 100644
--- a/src/project.cpp
+++ b/src/project.cpp
@@ -158,9 +158,9 @@ bool Project::DoLoadSubtitles(agi::fs::path const& path, std::string encoding, P
 	return true;
 }
 
-void Project::LoadSubtitles(agi::fs::path path, std::string encoding) {
+void Project::LoadSubtitles(agi::fs::path path, std::string encoding, bool load_linked) {
 	ProjectProperties properties;
-	if (DoLoadSubtitles(path, encoding, properties))
+	if (DoLoadSubtitles(path, encoding, properties) && load_linked)
 		LoadUnloadFiles(properties);
 }
 
diff --git a/src/project.h b/src/project.h
index 1fd034d08..385a41b4b 100644
--- a/src/project.h
+++ b/src/project.h
@@ -69,7 +69,7 @@ public:
 	Project(agi::Context *context);
 	~Project();
 
-	void LoadSubtitles(agi::fs::path path, std::string encoding="");
+	void LoadSubtitles(agi::fs::path path, std::string encoding="", bool load_linked=true);
 	void CloseSubtitles();
 	bool CanLoadSubtitlesFromVideo() const { return video_has_subtitles; }
 
-- 
GitLab