29 lines
541 B
C#
29 lines
541 B
C#
using Godot;
|
|
using ReEdit.Syntax;
|
|
using System;
|
|
using System.Diagnostics.SymbolStore;
|
|
|
|
public partial class TextEditor : CodeEdit
|
|
{
|
|
public string Extension = "lua";
|
|
|
|
public override void _Ready()
|
|
{
|
|
UpdateHighlighter();
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
}
|
|
|
|
public void UpdateHighlighter()
|
|
{
|
|
switch (Extension)
|
|
{
|
|
default: SyntaxHighlighter = new PlainText(); break; // things like plaintext, aswell as unrecongnized extensions
|
|
case "lua" or "luac" or "luau": SyntaxHighlighter = new Lua(); break;
|
|
}
|
|
|
|
}
|
|
}
|