Lexer for RBX Lua

with the function UpdateColors you can set “background” to some color

Ok, one last thing though, I was kinda hoping players could copy and paste the text but that doesn’t seem possible.

the text from the textbox or from the textlabel (where all the text is highlighted)?

Text from a textbox, unless you’re able to copy text to their clipboard automatically?

You should be able to copy any text from the textbox by just doing control + c. Roblox doesn’t have any way of copying stuff to the clipboard automatically so you gotta copy it yourself. If you turn “ClearTextOnFocus” off it shouldn’t reset when you try to click on the texbox.

But it creates textlabels under the textbox so they can’t even copy it manually.

I don’t think there is any other way sadly. I also don’t think a copy-to-clipboard feature will ever get released because a game could fill your clipboard with tons of stuff. The only solution would be to select the textbox text, unless there is a way to select textlabel text. You could make a button that shows a window with a textbox that can’t be edited. The textbox would have the same text as your original textbox where you put the code in, but in the new textbox you can select the text and copy it manually.

Ok, so do you know how I would return in a string? Because I added it to a constantly updating table like this:

explorer.ChildAdded:Connect(function()
	wait()
	local luaString = table.concat(luaTable, "")
	Highighter.Highlight(script.Parent.LuaCode, luaString)
end)

What is inside the luaTable? Does stuff get added or removed from it?

Oh, it’s just a bunch of strings and they get added and in the future will be able to be removed too.

Why exactly can’t you return the string? I don’t know what the problem is :sweat_smile:

Oh, I’m sorry I forgot there are two ways you could take that. I meant like the way you click enter on your keyboard and it makes a new line.

Turn MultiLine on in the textbox.

Yeah, but the whole table becomes one string and the table holds, what should look like, multiple lines of code.

you can separate a line with “\n” inside a string

1 Like

does anyone know how I can swap from rendering each line separately to rendering all the lines in a single label? Im having issues with rescaling my widget plugin

Sorry if I sound stupid, but, how would you use the navigator to navigate through specific lines? Heres an example:

while true do
task.wait()
end

I am making a linter so it can detect possible syntax errors and line searching is very useful. If I wanted to check for “do” in while true do, that would be easy peasy, but if I wanted to detect the “end” part, how would I check each line do that? Navigate each line and put each result into a table? Or do I just do a repeat loop until I find ‘end’ which I normally do with other stuff for single lines.

Is it possible to implement this on TextWrapped TextLabels? I was aware that it doesn’t support text wrapping.