diff --git a/CMakeLists.txt b/CMakeLists.txt index 7923df3..e4802d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8.8) project(juci) -set(JUCI_VERSION "1.2.1.4") +set(JUCI_VERSION "1.2.1.5") set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim ") diff --git a/src/config.cc b/src/config.cc index 8c388dd..cb2c880 100644 --- a/src/config.cc +++ b/src/config.cc @@ -141,14 +141,15 @@ bool Config::remove_deprecated_nodes(const boost::property_tree::ptree &default_ if(parent_path.size()>0) parent_path+="."; bool unchanged=true; - for(auto &node: config_cfg) { - auto path=parent_path+node.first; + for(auto it=config_cfg.begin();it!=config_cfg.end();) { + auto path=parent_path+it->first; try { default_cfg.get(path); - unchanged&=remove_deprecated_nodes(default_cfg, node.second, path); + unchanged&=remove_deprecated_nodes(default_cfg, it->second, path); + ++it; } catch(const std::exception &e) { - config_cfg.erase(node.first); + it=config_cfg.erase(it); unchanged=false; } } @@ -195,8 +196,8 @@ void Config::get_source() { source.show_whitespace_characters=source_json.get("show_whitespace_characters"); source.smart_brackets=source_json.get("smart_brackets"); - source.smart_insertions=source_json.get("smart_insertions"); - if(source.smart_insertions) + source.smart_inserts=source_json.get("smart_inserts"); + if(source.smart_inserts) source.smart_brackets=true; source.show_map = source_json.get("show_map"); diff --git a/src/config.h b/src/config.h index 0b232b7..abcfa73 100644 --- a/src/config.h +++ b/src/config.h @@ -61,7 +61,7 @@ public: std::string show_whitespace_characters; bool smart_brackets; - bool smart_insertions; + bool smart_inserts; bool show_map; std::string map_font_size; diff --git a/src/files.h b/src/files.h index 61f1041..205490b 100644 --- a/src/files.h +++ b/src/files.h @@ -41,10 +41,10 @@ R"RAW( "cleanup_whitespace_characters": false, "show_whitespace_characters_comment": "Determines what kind of whitespaces should be drawn. Use comma-separated list of: space, tab, newline, nbsp, leading, text, trailing or all", "show_whitespace_characters": "", - "smart_brackets_comment": "If smart_insertions is enabled, this option is automatically enabled. When inserting an already closed bracket, the cursor might instead be moved, avoiding the need of arrow keys after autocomplete", + "smart_brackets_comment": "If smart_inserts is enabled, this option is automatically enabled. When inserting an already closed bracket, the cursor might instead be moved, avoiding the need of arrow keys after autocomplete", "smart_brackets": true, - "smart_insertions_comment": "When for instance inserting (, () gets inserted. Applies to: (), [], \", '. Also enables pressing ; inside an expression before a final ) to insert ; at the end of line, and deletions of empty insertions", - "smart_insertions": false, + "smart_inserts_comment": "When for instance inserting (, () gets inserted. Applies to: (), [], \", '. Also enables pressing ; inside an expression before a final ) to insert ; at the end of line, and deletions of empty insertions", + "smart_inserts": false, "show_map": true, "map_font_size": "1", "show_git_diff": true, diff --git a/src/source.cc b/src/source.cc index 09fdfda..a4629c4 100644 --- a/src/source.cc +++ b/src/source.cc @@ -1230,7 +1230,7 @@ bool Source::View::on_key_press_event(GdkEventKey* key) { get_buffer()->end_user_action(); return true; } - if(Config::get().source.smart_insertions && on_key_press_event_smart_insertions(key)) { + if(Config::get().source.smart_inserts && on_key_press_event_smart_inserts(key)) { get_buffer()->end_user_action(); return true; } @@ -1788,7 +1788,7 @@ bool Source::View::on_key_press_event_smart_brackets(GdkEventKey *key) { return false; } -bool Source::View::on_key_press_event_smart_insertions(GdkEventKey *key) { +bool Source::View::on_key_press_event_smart_inserts(GdkEventKey *key) { if(get_buffer()->get_has_selection()) { bool perform_insertion=false; char left_char, right_char; diff --git a/src/source.h b/src/source.h index bd56217..d7cd6f2 100644 --- a/src/source.h +++ b/src/source.h @@ -140,7 +140,7 @@ namespace Source { bool on_key_press_event_basic(GdkEventKey* key); bool on_key_press_event_bracket_language(GdkEventKey* key); bool on_key_press_event_smart_brackets(GdkEventKey* key); - bool on_key_press_event_smart_insertions(GdkEventKey* key); + bool on_key_press_event_smart_inserts(GdkEventKey* key); bool on_button_press_event(GdkEventButton *event) override; bool on_focus_in_event(GdkEventFocus* focus_event) override;