Skip to content
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

Change terminal path on project change even if not visible #1525

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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 @@ -637,11 +637,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 @@ -1391,11 +1387,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);
}

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
Loading