Commit 7d1e4955 authored by Ole Christian Eidheim's avatar Ole Christian Eidheim
Browse files

Fixes #443: added preference item for keeping entry shown after running command

parent f853ae9d
Pipeline #248662229 passed with stages
in 16 minutes and 22 seconds
cmake_minimum_required(VERSION 3.1)
project(juci)
set(JUCI_VERSION "1.6.2")
set(JUCI_VERSION "1.6.2.1")
set(CPACK_PACKAGE_NAME "jucipp")
set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim <eidheim@gmail.com>")
......
......@@ -209,6 +209,7 @@ void Config::read(const boost::property_tree::ptree &cfg) {
terminal.font = cfg.get<std::string>("terminal.font");
terminal.clear_on_compile = cfg.get<bool>("terminal.clear_on_compile");
terminal.clear_on_run_command = cfg.get<bool>("terminal.clear_on_run_command");
terminal.hide_entry_on_run_command = cfg.get<bool>("terminal.hide_entry_on_run_command");
log.libclang = cfg.get<bool>("log.libclang");
log.language_server = cfg.get<bool>("log.language_server");
......
......@@ -27,6 +27,7 @@ public:
std::string font;
bool clear_on_compile;
bool clear_on_run_command;
bool hide_entry_on_run_command;
};
class Project {
......
......@@ -110,6 +110,6 @@ void EntryBox::show() {
show_all();
if(entries.size() > 0) {
entries.begin()->grab_focus();
entries.begin()->select_region(0, entries.begin()->get_text_length());
entries.begin()->select_region(0, -1);
}
}
......@@ -84,7 +84,8 @@ const std::string default_config_file =
"font_comment": "Use \"\" to use source.font with slightly smaller size",
"font": "",
"clear_on_compile": true,
"clear_on_run_command": false
"clear_on_run_command": false,
"hide_entry_on_run_command": true
},
"project": {
"default_build_path_comment": "Use <project_directory_name> to insert the project top level directory name",
......
......@@ -1394,7 +1394,10 @@ void Window::set_menu_actions() {
Terminal::get().async_print("\e[2m" + content + " returned: " + (exit_status == 0 ? "\e[32m" : "\e[31m") + std::to_string(exit_status) + "\e[m\n");
});
}
EntryBox::get().hide();
if(Config::get().terminal.hide_entry_on_run_command)
EntryBox::get().hide();
else
EntryBox::get().entries.front().select_region(0, -1);
},
30);
auto entry_it = EntryBox::get().entries.begin();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment