https://ibb.co/VV0HKQn
This is the sample result of my configuration.
Keywords seems to not be highlighted.
Anyone has a solution? I tried to read LUA examples and the result below is something that is almost 1:1 copy
I have no clue why it wouldn't work. Even just leaving setKeywords line won't work. Please help
Code: Select all
editor_->StyleResetDefault();
editor_->StyleSetSize(wxSTC_STYLE_DEFAULT, 10);
editor_->StyleClearAll();
editor_->SetTabWidth(4);
editor_->SetMarginWidth(0, 30);
editor_->StyleSetForeground(wxSTC_STYLE_LINENUMBER, wxColour(75, 75, 75));
editor_->StyleSetBackground(wxSTC_STYLE_LINENUMBER, wxColour(220, 220, 220));
editor_->SetMarginType(0, wxSTC_MARGIN_NUMBER);
editor_->StyleSetForeground(wxSTC_LUA_DEFAULT, wxColour(0, 0, 0));
editor_->StyleSetForeground(wxSTC_LUA_COMMENT, wxColour(0, 127, 0));
editor_->StyleSetForeground(wxSTC_LUA_COMMENTLINE, wxColour(0, 127, 0));
editor_->StyleSetForeground(wxSTC_LUA_NUMBER, wxColour(0, 0, 127));
editor_->StyleSetForeground(wxSTC_LUA_WORD, wxColour(0, 0, 255));
editor_->StyleSetForeground(wxSTC_LUA_WORD2, wxColour(0, 128, 192));
editor_->StyleSetForeground(wxSTC_LUA_WORD3, wxColour(128, 0, 255));
editor_->StyleSetForeground(wxSTC_LUA_WORD4, wxColour(0, 0, 160));
editor_->StyleSetForeground(wxSTC_LUA_STRING, wxColour(255, 0, 0));
editor_->StyleSetForeground(wxSTC_LUA_CHARACTER, wxColour(255, 0, 0));
editor_->StyleSetForeground(wxSTC_LUA_LITERALSTRING, wxColour(222, 0, 0));
editor_->StyleSetForeground(wxSTC_LUA_STRINGEOL, wxColour(111, 0, 0));
editor_->StyleSetForeground(wxSTC_LUA_OPERATOR, wxColour(0, 0, 160));
editor_->StyleSetForeground(wxSTC_LUA_PREPROCESSOR, wxColour(255, 0, 0));
editor_->SetWordChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
editor_->StyleSetBold(wxSTC_LUA_WORD, true);
editor_->StyleSetBold(wxSTC_LUA_NUMBER, true);
editor_->SetKeyWords(0, "and break do else elseif end for function if in local nil not or repeat return then until while false true goto");
editor_->SetKeyWords(1, "assert collectgarbage dofile error _G getmetatable ipairs loadfile next pairs pcall print rawequal rawget rawset setmetatable tonumber tostring type _VERSION xpcall string table math coroutine io os debug getfenv gcinfo load loadlib loadstring require select setfenv unpack _LOADED LUA_PATH _REQUIREDNAME package rawlen package bit32 utf8 _ENV");
// String Manipulation & Mathematical
editor_->SetKeyWords(2, "string.byte string.char string.dump string.find string.format string.gsub string.len string.lower string.rep string.sub string.upper table.concat table.insert table.remove table.sort math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.deg math.exp math.floor math.frexp math.ldexp math.log math.max math.min math.pi math.pow math.rad math.random math.randomseed math.sin math.sqrt math.tan string.gfind string.gmatch string.match string.reverse string.pack string.packsize string.unpack table.foreach table.foreachi table.getn table.setn table.maxn table.pack table.unpack table.move math.cosh math.fmod math.huge math.log10 math.modf math.mod math.sinh math.tanh math.maxinteger math.mininteger math.tointeger math.type math.ult bit32.arshift bit32.band bit32.bnot bit32.bor bit32.btest bit32.bxor bit32.extract bit32.replace bit32.lrotate bit32.lshift bit32.rrotate bit32.rshift utf8.char utf8.charpattern utf8.codes utf8.codepoint utf8.len utf8.offset");
// Input and Output Facilities and System Facilities
editor_->SetKeyWords(3, "coroutine.create coroutine.resume coroutine.status coroutine.wrap coroutine.yield io.close io.flush io.input io.lines io.open io.output io.read io.tmpfile io.type io.write io.stdin io.stdout io.stderr os.clock os.date os.difftime os.execute os.exit os.getenv os.remove os.rename os.setlocale os.time os.tmpname coroutine.isyieldable coroutine.running io.popen module package.loaders package.seeall package.config package.searchers package.searchpath require package.cpath package.loaded package.loadlib package.path package.preload");
editor_->SetLexer(wxSTC_LEX_LUA);