Unable to edit log file lexer properties

sl23
Posts: 233
Joined: 29.01.2013 10:04

Unable to edit log file lexer properties

Post by sl23 »

Not sure if I am using the correct terminology. I can select lexer type ok, for log files, only one shows: Log files ^
But clicking the lexer properties button works on other file types but does nothing for log files. How do I fix this?
Thanks.
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 3197
Joined: 25.08.2021 18:15

Re: Unable to edit log file lexer properties

Post by main Alexey »

not a bug.

'Log files ^' means it is LITE lexer.
Wiki: https://wiki.freepascal.org/CudaText#Lite_lexers
LITE lexers do not have config-dialog for them, so app does nothing. from next update 1.236.x.y, app will show the error-msgbox about this fact, when you call 'Lexer properties' for lite lexer.
sl23
Posts: 233
Joined: 29.01.2013 10:04

Re: Unable to edit log file lexer properties

Post by sl23 »

oh ok. Is it possible to add a lexer properties for Log files? Thank you.
Live for an ideal and leave no place in the mind for anything else.
sl23
Posts: 233
Joined: 29.01.2013 10:04

Re: Unable to edit log file lexer properties

Post by sl23 »

I didnt mean for you to do so, I meant can I add a new one? How do i go about it? Do I put them in the lexlib folder and they are automatically read on startup? Do they persist on updates, ie do not get deleted?
Thanks for your help.
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 3197
Joined: 25.08.2021 18:15

Re: Unable to edit log file lexer properties

Post by main Alexey »

- you cannot add 'lexer props' dialog for _lite_ lexers. lite lexers don't have props which we need to change.
- lite lexers are in the data/lexliblite subfolder. yes they persist on updates. no, user cannot copy them to data/lexlib, because file format of usual lexers is different (usual lexers - .LCF ; lite lexers - .JSON).
sl23
Posts: 233
Joined: 29.01.2013 10:04

Re: Unable to edit log file lexer properties

Post by sl23 »

ok, I understand, but I meant can they be created from scratch?
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 3197
Joined: 25.08.2021 18:15

Re: Unable to edit log file lexer properties

Post by main Alexey »

of course, lite lexers can be / must be created from scratch. just make the similar JSON blocks, similar to existing lexers.
sl23
Posts: 233
Joined: 29.01.2013 10:04

Re: Unable to edit log file lexer properties

Post by sl23 »

lol, sorry for the confusion, I mean can I make new lexers that can be edited so I can edit their properties in the lexlib folder?
In other words, create two new files:
Log.cuda-lexmap
Log.lcf
So they can be used as a typical lexer and allow editing of their properties as normal. Can that be done?
Thanks.
Live for an ideal and leave no place in the mind for anything else.
sl23
Posts: 233
Joined: 29.01.2013 10:04

Re: Unable to edit log file lexer properties

Post by sl23 »

Worked a treat! Thanks Alexey! :)
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 3197
Joined: 25.08.2021 18:15

Re: Unable to edit log file lexer properties

Post by main Alexey »

of course, you can make a new lexer in LCF format. for any format, for LOG too.
example existed here:
https://github.com/CudaText-addons/Cuda ... r/Logfiles

(it highlites special words in LOG files, in german lang too; author is German man)

but, if user opens a 500MB log-file with .LCF lexer, work will be very slow, even if user will change option "ui_max_size_lexer" to 501.
Post Reply