mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09: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:
commit
fd75707035
2 changed files with 68 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue