Page 1 of 1

registerLuaFunctionHighlight

Posted: Tue Nov 30, 2021 3:31 pm
by S1N74X
Hello,

are there any requirements for "registerLuaFunctionHighlight"
The Documentation just says "registerLuaFunctionHighlight(functionname): Makes the lua highlighter show the functionname as a functionkeyword"

Code: Select all

function myFunc(Parameters)
do some stuff
end

--register the function for highlight
registerLuaFunctionHighlight(myFunc)
After activating the functionscript, nothing happens. There is no highlighting as supposed.

Any usefull ideas or suggestions are welcome :)

Re: registerLuaFunctionHighlight

Posted: Tue Nov 30, 2021 3:51 pm
by LeFiXER
It doesn't appear to be working but I don't think it's a huge issue because it's just function highlighting. You could always affix an underscore to function names that are to do with Lua.

Re: registerLuaFunctionHighlight

Posted: Tue Nov 30, 2021 5:40 pm
by S1N74X
LeFiXER wrote:
Tue Nov 30, 2021 3:51 pm
It doesn't appear to be working but I don't think it's a huge issue because it's just function highlighting. You could always affix an underscore to function names that are to do with Lua.
Thank you.
Maybe it will work in the Future.

Re: registerLuaFunctionHighlight

Posted: Wed Dec 01, 2021 2:36 pm
by Eric
it says functionname, not function

You use it like this:

Code: Select all

function myfunction()
end
registerLuaFunctionHighlight('myfunction')
from then on when you type myfunction in lua it will get highlighted as a function

Re: registerLuaFunctionHighlight

Posted: Wed Dec 01, 2021 5:37 pm
by S1N74X
Eric wrote:
Wed Dec 01, 2021 2:36 pm
it says functionname, not function

You use it like this:

Code: Select all

function myfunction()
end
registerLuaFunctionHighlight('myfunction')
from then on when you type myfunction in lua it will get highlighted as a function
Awesome. Works thank you.
Maybe they should write "functionname as string". Would be clearer.
If you come from C++, C# or Java a functionname is a functionname and not a string :)