You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
GDScript: Highlight code region comments
This commit is contained in:
@@ -39,6 +39,15 @@ class GDScriptSyntaxHighlighter : public EditorSyntaxHighlighter {
|
||||
|
||||
private:
|
||||
struct ColorRegion {
|
||||
enum Type {
|
||||
TYPE_NONE,
|
||||
TYPE_STRING, // `"` and `'`, optional prefix `&`, `^`, or `r`.
|
||||
TYPE_MULTILINE_STRING, // `"""` and `'''`, optional prefix `r`.
|
||||
TYPE_COMMENT, // `#` and `##`.
|
||||
TYPE_CODE_REGION, // `#region` and `#endregion`.
|
||||
};
|
||||
|
||||
Type type = TYPE_NONE;
|
||||
Color color;
|
||||
String start_key;
|
||||
String end_key;
|
||||
@@ -94,7 +103,7 @@ private:
|
||||
Color comment_marker_colors[COMMENT_MARKER_MAX];
|
||||
HashMap<String, CommentMarkerLevel> comment_markers;
|
||||
|
||||
void add_color_region(const String &p_start_key, const String &p_end_key, const Color &p_color, bool p_line_only = false);
|
||||
void add_color_region(ColorRegion::Type p_type, const String &p_start_key, const String &p_end_key, const Color &p_color, bool p_line_only = false);
|
||||
|
||||
public:
|
||||
virtual void _update_cache() override;
|
||||
|
||||
Reference in New Issue
Block a user