Skip to content
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
13 changes: 6 additions & 7 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,7 @@ namespace Scratch {

sidebar.choose_project_button.project_chosen.connect (() => {
folder_manager_view.collapse_other_projects ();
if (terminal.visible) {
var open_in_terminal_action = Utils.action_from_group (ACTION_OPEN_IN_TERMINAL, actions);
var param = new Variant.string (Services.GitManager.get_instance ().get_default_build_dir (null));
open_in_terminal_action.activate (param);
}
change_terminal_path (Services.GitManager.get_instance ().get_default_build_dir (null));
});

set_widgets_sensitive (false);
Expand Down Expand Up @@ -1376,11 +1372,14 @@ namespace Scratch {

//If param is null or empty, the active project path build dir is returned or failing that
//the active document path
var target_path = get_target_path_for_actions (param, true);
terminal.change_location (target_path);
change_terminal_path (get_target_path_for_actions (param, true));
terminal.terminal.grab_focus ();
}

private void change_terminal_path (string path) {
terminal.change_location (path);
}
Comment on lines +1379 to +1381
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this probably doesn't need to be a separate function. This seems like it just obfuscates the code. terminal.change_location is already pretty obvious in what it does

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.


private void action_toggle_outline (SimpleAction action) {
action.set_state (!action.get_state ().get_boolean ());
document_view.outline_visible = action.get_state ().get_boolean ();
Expand Down