From d600016a1b84a3ba1dba60bcbd2a7d8e30077ecd Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Wed, 9 Oct 2024 21:15:36 +0100 Subject: [PATCH] Add saved and renamed docs to RecentManager (#1467) --- src/FolderManager/FileView.vala | 3 +++ src/Services/Document.vala | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FolderManager/FileView.vala b/src/FolderManager/FileView.vala index 684074922..9fa2800d5 100644 --- a/src/FolderManager/FileView.vala +++ b/src/FolderManager/FileView.vala @@ -322,6 +322,9 @@ public class Scratch.FolderManager.FileView : Code.Widgets.SourceList, Code.Pane selected.disconnect (once); var new_path = Path.get_dirname (path) + Path.DIR_SEPARATOR_S + new_name; this.toplevel_action_group.activate_action (MainWindow.ACTION_CLOSE_TAB, new Variant.string (path)); + // RecentManager requires valid URI + var new_uri = "file://" + new_path; // Code only edits local files + Gtk.RecentManager.get_default ().add_item (new_uri); this.select (new_path); }); } diff --git a/src/Services/Document.vala b/src/Services/Document.vala index 5ea4e1b87..2505959e1 100644 --- a/src/Services/Document.vala +++ b/src/Services/Document.vala @@ -635,7 +635,7 @@ namespace Scratch.Services { } - + Gtk.RecentManager.get_default ().add_item (get_uri ()); debug ("File ā€œ%sā€ saved successfully", get_basename ()); return true;