-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua new syntax suggestion - too many things are highlighted as variables currently #1899
Comments
I agree with your assessment that coloring everything in the file, especially all variables, produces very colorful code and means you likely end up having no white text at all (which is why I modfified my color scheme not to do that). However, from a syntax definition perspective it is correct to scope all variables as, well, |
Hm, maybe the issue for me then isn't that everything is colored as a variable, but rather that there isn't a separate scope for table entries which are also functions. I tried changing my variable color to white, but it was a lot harder to read the highlighting when functions weren't highlighted. I'm not sure which scope is which but could "variable" functions be colored the same as built-in functions? Or alternatively is there another available scope that could be used to separate variables-that-are-functions from variables-that-aren't-functions for Lua? For reference, here is a screenshot of code highlighted how I want it to look. Here is that same snippet with everything as a variable, and finally here is variables highlighted white. IMO the first one is obviously the most "correct" way to have functions distinguished from things that aren't functions. As an aside, I use ST as my Lua IDE because I work on wikis, and the Mediawiker package is unparalleled in utility for this purpose. Maybe include Scribunto's libraries as defaults? I'm not sure how widespread this use is though |
function h.makeTogglerButtons(togglers, n)
local tbl = {}
tbl[1] = h.makeToggler(n, 1)
for i, _ in ipairs(togglers) do
if i == #togglers then
tbl[ftb1+1] = h.makeLastToggler(n)
else
-- first add 1 because we already did 1 from the default bracket
tbl[#tbl+1] = h.makeToggler(n, i + 1)
end
end
return tbl
end My slightly-tweaked Mariana looks kind of like your desired output: I think you need to modify your color scheme to set |
Oh thanks! I didn't realize that was possible. Yeah, this is fine as-is then. |
I fixed this for myself with this change:
The scope in the third item is by default
variable.other.lua
. This way most text is defaulted to the normal color, and actual function names are much more easily distinguished (behavior is also more similar to the LuaExtended).The text was updated successfully, but these errors were encountered: