Browse Source

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

xdg
eidheim 5 years ago
parent
commit
7d1e49559f
  1. 2
      CMakeLists.txt
  2. 1
      src/config.cpp
  3. 1
      src/config.hpp
  4. 2
      src/entrybox.cpp
  5. 3
      src/files.hpp
  6. 5
      src/window.cpp

2
CMakeLists.txt

@ -1,7 +1,7 @@
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>")

1
src/config.cpp

@ -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");

1
src/config.hpp

@ -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 {

2
src/entrybox.cpp

@ -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);
}
}

3
src/files.hpp

@ -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",

5
src/window.cpp

@ -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();

Loading…
Cancel
Save