You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #78312 from Calinou/editor-add-markdown-highlighting
Add Markdown syntax highlighting to the script editor
This commit is contained in:
@@ -120,6 +120,24 @@ public:
|
||||
EditorJSONSyntaxHighlighter() { highlighter.instantiate(); }
|
||||
};
|
||||
|
||||
class EditorMarkdownSyntaxHighlighter : public EditorSyntaxHighlighter {
|
||||
GDCLASS(EditorMarkdownSyntaxHighlighter, EditorSyntaxHighlighter)
|
||||
|
||||
private:
|
||||
Ref<CodeHighlighter> highlighter;
|
||||
|
||||
public:
|
||||
virtual void _update_cache() override;
|
||||
virtual Dictionary _get_line_syntax_highlighting_impl(int p_line) override { return highlighter->get_line_syntax_highlighting(p_line); }
|
||||
|
||||
virtual PackedStringArray _get_supported_languages() const override { return PackedStringArray{ "md", "markdown" }; }
|
||||
virtual String _get_name() const override { return TTR("Markdown"); }
|
||||
|
||||
virtual Ref<EditorSyntaxHighlighter> _create() const override;
|
||||
|
||||
EditorMarkdownSyntaxHighlighter() { highlighter.instantiate(); }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ScriptEditorQuickOpen : public ConfirmationDialog {
|
||||
|
||||
Reference in New Issue
Block a user