Skip to content

Commit

Permalink
Add dedicated text-event syntax highlighter (#1797)
Browse files Browse the repository at this point in the history
It's the same script but with a flag switched.
  • Loading branch information
Jowan-Spooner committed Oct 9, 2023
1 parent b25fc70 commit 4a8820f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/dialogic/Editor/Events/Fields/MultilineText.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ signal value_changed

func _ready() -> void:
text_changed.connect(_on_text_changed)
syntax_highlighter = code_completion_helper.syntax_highlighter
syntax_highlighter = code_completion_helper.text_syntax_highlighter


func _on_text_changed(value := "") -> void:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ extends Node
enum Modes {TEXT_EVENT_ONLY, FULL_HIGHLIGHTING}

var syntax_highlighter :SyntaxHighlighter = load("res://addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd").new()
var text_syntax_highlighter :SyntaxHighlighter = load("res://addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd").new()


# These RegEx's are used to deduce information from the current line for auto-completion

Expand All @@ -24,6 +26,8 @@ func _ready():
completion_word_regex.compile("(?<s>(\\W)|^)(?<word>\\w*)\\x{FFFF}")
completion_shortcode_getter_regex.compile("\\[(?<code>\\w*)")
completion_shortcode_param_getter_regex.compile("(?<param>\\w*)\\W*=\\s*\"?(\\w|\\s)*"+String.chr(0xFFFF))

text_syntax_highlighter.mode = text_syntax_highlighter.Modes.TEXT_EVENT_ONLY

################################################################################
## AUTO COMPLETION
Expand Down

0 comments on commit 4a8820f

Please sign in to comment.