From 55f48b71e51a3938e6bfb0814334f3f864bee90b Mon Sep 17 00:00:00 2001
From: Albert Graef <aggraef@gmail.com>
Date: Fri, 20 Jan 2017 06:02:03 +0100
Subject: [PATCH] Change opendir to the last directory we saved in, so that a
 subsequent Open shows that directory again.

---
 pd/nw/pdgui.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index aaedfc4c3..c394afb9d 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -741,6 +741,8 @@ function saveas_callback(cid, file, close_flag) {
     }
     pdsend(cid, "savetofile", enquote(basename), enquote(directory),
         close_flag);
+    // XXXREVIEW: It seems sensible that we also switch the opendir here. -ag
+    set_pd_opendir(directory);
     // update the recent files list
     var norm_path = path.normalize(directory);
     pdsend("pd add-recent-file", enquote(path.join(norm_path, basename)));
-- 
GitLab