@elextr I think, all ```SCI_*LEXER*``` are not really needed in this plugin (so they can stay in this list and no more), also you wrote
You should not set the lexer directly, set the Geany filetype instead.
[here](https://github.com/geany/geany-plugins/issues/646). Now we can get the current filetype ```lua local finfo = geany.fileinfo() if finfo ~= nil then geany.message('Current filetype is "' .. finfo.type .. '": ' .. finfo.desc) end ``` and it may be useful to change the current filetype: something like ```geany.settype(".cmake")``` with ```c /* Change the current file type by the specified file extension */ static gint glspi_set_filetype(lua_State* L) { GeanyDocument *doc=NULL; GeanyFiletype *ft=NULL; const gchar *ftn=NULL;
if (lua_gettop(L)==1){ if (!lua_isstring(L, 1)) { return FAIL_STRING_ARG(1); } doc = document_get_current(); if (!(doc && doc->is_valid)) { return 0; } ftn=lua_tostring(L, 1); if ('\0' == ftn[0]) { return 0; } ft=filetypes_detect_from_extension(ftn); if (ft != NULL){ document_set_filetype(doc, ft); return 1; } } return 0; } ``` in ```glspi_doc.c```. But currently ```filetypes_detect_from_extension``` is not a prt of Geany API.