diff --git a/CMakeLists.txt b/CMakeLists.txt index 974faab..ab8198a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8.8) project(juci) -set(JUCI_VERSION "1.5.0") +set(JUCI_VERSION "1.5.0.1") set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim ") diff --git a/src/config.cc b/src/config.cc index f810e38..bc19c00 100644 --- a/src/config.cc +++ b/src/config.cc @@ -175,6 +175,7 @@ void Config::read(const boost::property_tree::ptree &cfg) { source.auto_reload_changed_files = source_json.get("auto_reload_changed_files"); source.clang_format_style = source_json.get("clang_format_style"); source.clang_usages_threads = static_cast(source_json.get("clang_usages_threads")); + source.debug_place_cursor_at_stop = source_json.get("debug_place_cursor_at_stop"); auto pt_doc_search = cfg.get_child("documentation_searches"); for(auto &pt_doc_search_lang : pt_doc_search) { source.documentation_searches[pt_doc_search_lang.first].separator = pt_doc_search_lang.second.get("separator"); diff --git a/src/config.h b/src/config.h index 304383c..eab7db4 100644 --- a/src/config.h +++ b/src/config.h @@ -92,6 +92,8 @@ public: std::string clang_format_style; unsigned clang_usages_threads; + bool debug_place_cursor_at_stop; + std::unordered_map documentation_searches; }; diff --git a/src/files.h b/src/files.h index 4caa1b6..2e1b73e 100644 --- a/src/files.h +++ b/src/files.h @@ -65,7 +65,8 @@ const std::string default_config_file = R"RAW({ "clang_format_style_comment": "IndentWidth, AccessModifierOffset and UseTab are set automatically. See http://clang.llvm.org/docs/ClangFormatStyleOptions.html", "clang_format_style": "ColumnLimit: 0, NamespaceIndentation: All", "clang_usages_threads_comment": "The number of threads used in finding usages in unparsed files. -1 corresponds to the number of cores available, and 0 disables the search", - "clang_usages_threads": -1 + "clang_usages_threads": -1, + "debug_place_cursor_at_stop": false }, "terminal": { "history_size": 1000, diff --git a/src/project.cc b/src/project.cc index 8b6d727..ccb6435 100644 --- a/src/project.cc +++ b/src/project.cc @@ -447,7 +447,14 @@ void Project::LLDB::debug_start() { Project::debug_stop.second.first = stop_line; Project::debug_stop.second.second = stop_column; debug_update_stop(); - if(auto view = Notebook::get().get_current_view()) + + if(Config::get().source.debug_place_cursor_at_stop && !stop_path.empty()) { + Notebook::get().open(stop_path); + auto view = Notebook::get().get_current_view(); + view->place_cursor_at_line_index(stop_line, stop_column); + view->scroll_to_cursor_delayed(view, true, false); + } + else if(auto view = Notebook::get().get_current_view()) view->get_buffer()->place_cursor(view->get_buffer()->get_insert()->get_iter()); }); });