Skip to content

Open README.md when opening folder. #1108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
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
8 changes: 6 additions & 2 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,11 @@ namespace Scratch {
public void open_folder (File folder) {
var foldermanager_file = new FolderManager.File (folder.get_path ());
folder_manager_view.open_folder (foldermanager_file);
var readme_file = folder.get_child ("README.md");
if (readme_file.query_exists ()) {
var doc = new Scratch.Services.Document (actions, readme_file);
open_document (doc);
}
}

public void open_document (Scratch.Services.Document doc,
Expand Down Expand Up @@ -871,8 +876,7 @@ namespace Scratch {

if (chooser.run () == Gtk.ResponseType.ACCEPT) {
chooser.get_files ().foreach ((glib_file) => {
var foldermanager_file = new FolderManager.File (glib_file.get_path ());
folder_manager_view.open_folder (foldermanager_file);
open_folder (glib_file);
});
}

Expand Down