summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2018-04-12 22:26:15 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2018-04-20 20:54:31 +0100
commit4cd16f6ba90c0dce40672f550f403fb76a74a940 (patch)
tree3f1c6d9cddbb44fb6dcedbfea4af7c304ff4b229 /modules/gdscript
parent28dfc7f915fab258d38cb6081ea0f1611b87da68 (diff)
Added GDScript function definition highlighting
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp11
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index ac65b5bcb1..9e9e3df0ee 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -29,7 +29,9 @@
/*************************************************************************/
#include "gdscript_highlighter.h"
+#include "../gdscript_tokenizer.h"
#include "scene/gui/text_edit.h"
+#include "editor/editor_settings.h"
inline bool _is_symbol(CharType c) {
@@ -232,7 +234,12 @@ Map<int, TextEdit::HighlighterInfo> GDScriptSyntaxHighlighter::_get_line_syntax_
color = member_color;
} else if (in_function_name) {
next_type = FUNCTION;
- color = function_color;
+
+ if (previous_text == GDScriptTokenizer::get_token_name(GDScriptTokenizer::TK_PR_FUNCTION)) {
+ color = function_definition_color;
+ } else {
+ color = function_color;
+ }
} else if (is_symbol) {
next_type = SYMBOL;
color = symbol_color;
@@ -294,6 +301,8 @@ void GDScriptSyntaxHighlighter::_update_cache() {
function_color = text_editor->get_color("function_color");
number_color = text_editor->get_color("number_color");
member_color = text_editor->get_color("member_variable_color");
+
+ function_definition_color = EDITOR_DEF("text_editor/highlighting/gdscript/function_definition_color", Color::html("#01e1ff"));
}
SyntaxHighlighter *GDScriptSyntaxHighlighter::create() {
diff --git a/modules/gdscript/editor/gdscript_highlighter.h b/modules/gdscript/editor/gdscript_highlighter.h
index 91c913be86..2180021735 100644
--- a/modules/gdscript/editor/gdscript_highlighter.h
+++ b/modules/gdscript/editor/gdscript_highlighter.h
@@ -50,6 +50,7 @@ private:
Color font_color;
Color symbol_color;
Color function_color;
+ Color function_definition_color;
Color built_in_type_color;
Color number_color;
Color member_color;