Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/FolderManager/FileView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Scratch.FolderManager {
private GLib.Settings settings;

public signal void select (string file);
public signal void close_all_docs_from_path (string path);

// This is a workaround for SourceList silliness: you cannot remove an item
// without it automatically selecting another one.
Expand Down Expand Up @@ -143,6 +144,7 @@ namespace Scratch.FolderManager {

folder_root.expanded = expand;
folder_root.closed.connect (() => {
close_all_docs_from_path (folder_root.file.path);
root.remove (folder_root);
write_settings ();
});
Expand Down
9 changes: 9 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,15 @@ namespace Scratch {
}
});

folder_manager_view.close_all_docs_from_path.connect ((a) => {
var docs = document_view.docs.copy ();
docs.foreach ((doc) => {
if (doc.file.get_path ().has_prefix (a)) {
document_view.close_document (doc);
}
});
});

folder_manager_view.restore_saved_state ();

bottombar = new Gtk.Notebook ();
Expand Down