Skip to content

Commit

Permalink
Option to toggle syntax highlighting
Browse files Browse the repository at this point in the history
(cherry picked from commit d78e98e)
  • Loading branch information
Paulb23 authored and akien-mga committed Apr 6, 2016
1 parent b389124 commit bb6cfc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tools/editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15));
set("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15));

set("text_editor/syntax_highlighting", true);

set("text_editor/highlight_all_occurrences", true);
set("text_editor/scroll_past_end_of_file", false);

Expand Down
3 changes: 2 additions & 1 deletion tools/editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ void ScriptTextEditor::_load_theme_settings() {

Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2));

get_text_edit()->set_syntax_coloring(true);
List<String> keywords;
script->get_language()->get_reserved_words(&keywords);
for(List<String>::Element *E=keywords.front();E;E=E->next()) {
Expand Down Expand Up @@ -1923,6 +1922,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
ste->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
ste->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
ste->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
ste->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
ste->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
ste->get_text_edit()->set_callhint_settings(
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
Expand Down Expand Up @@ -2064,6 +2064,7 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size"));
ste->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs"));
ste->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers"));
ste->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting"));
ste->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences"));
}

Expand Down

0 comments on commit bb6cfc1

Please sign in to comment.