Skip to content

Commit

Permalink
Add saved and renamed docs to RecentManager (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Oct 9, 2024
1 parent f49d00d commit d600016
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/FolderManager/FileView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Document.vala
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ namespace Scratch.Services {
}



Gtk.RecentManager.get_default ().add_item (get_uri ());
debug ("File “%s” saved successfully", get_basename ());

return true;
Expand Down

0 comments on commit d600016

Please sign in to comment.