Page 1 of 1

Good news...

Posted: 07.06.2020 09:42
by tmsg
... some more suggestions :D :D :D Nothing of the following is really important, just some ideas.

1. I am not sure how the tabs in the switch-tab dialog are sorted but whatever sort order there may be I find it not very intuitive. For me it would be perfect if there was an option to order the lines in the dialog the same as the actual tab order (ie first line in dialog is left-most tab, second line is left-most+1, ..., last line is right-most).

2. How can I edit a .cuda-session file from the command line? If I start cudatext with "cudatext test.cuda-session" this just loads the files in the session. Would a command-line option make sense? (It's possible to load a .cuda-session file via File>>Open... so it's not that important.) EDIT: Perhaps a better idea is to add an Edit file... command to the Session plugin... I could do that on my own.

3. An idea for the Lua lexer, although it may be usable for other, similar lexers as well. There is probably some work involved so see this as a modest suggestion for some future expansion. Like Cud, AkelPad has a Lua lexer and this lexer has a nice way of highlighting Lua syntactical blocks (keywords like function if then else end etc.), see the short video here: https://imgur.com/a/Qqa5WPx . I think that Cud has all (or almost all) the required information as this is a prerequisite for the code folding but I have no idea how hard it would be to implement this sort of thing.

Just an :idea:

And thanks @Alexey for the lexer line length thing... it always amazes me how fast you do these things.

Posted: 07.06.2020 12:47
by tmsg
tmsg wrote:EDIT: Perhaps a better idea is to add an Edit file... command to the Session plugin... I could do that on my own.
Hm... tried to do that. The simple-minded approach via

Code: Select all

file_open(app_path(APP_FILE_SESSION))
doesn't work... this simply saves and reloads the session. :oops: :D
The following works but it does an unnecessary save step in the last line, just to give the new tab its name:

Code: Select all

def loadSessfile(self):
	sess=app_path(APP_FILE_SESSION)
	f=open(sess)
	txt=f.read()
	f.close()
	file_open('')
	ed.set_text_all(txt)
	ed.save(sess)
Works but not yet optimal. Perhaps a plugin guru has an idea.

Posted: 07.06.2020 17:50
by Alexey
2. file_open(fn, options=....)
You can try these options-
If it has "/noevent", then "on_open_pre" event won't fire.
If it has "/noopenedevent", then "on_open" event won't fire.

Posted: 08.06.2020 06:48
by Alexey
3. Idea for Lua lexer.
I added dynamic-highlight rules to lexer. please test, download 2 files Lua.*
https://github.com/Alexey-T/CudaText/tr ... ata/lexlib
Cud option must be set: lexer_dynamic_hilite

Posted: 08.06.2020 07:00
by Alexey
1. TabSwitcher dialog. not a good idea, now we have order of lines from last actiavated time of each tab, so Ctrl+Tab n times (with holded Ctrl)--> n steps back
https://wiki.freepascal.org/CudaText#Tab_switcher

Posted: 08.06.2020 09:45
by tmsg
Alexey wrote:2. file_open(fn, options=....)
You can try these options-
If it has "/noevent", then "on_open_pre" event won't fire.
It seems the "on_open_pre" event has to be suppressed. I hadn't realised how the session plugin does its jobs... but I should have checked this on my own in install.inf :oops: Many thanks for putting me on the right track :idea: .
EDIT: For the sake of completeness, the added command code looks like this:

Code: Select all

def loadSessfile(self):
		file_open(app_path(APP_FILE_SESSION),-1,'/noevent')
I may at some point rewrite the whole plugin as it does some things I don't need and doesn't do other things... a nice way to learn more about the plugin system.
Alexey wrote:3. Idea for Lua lexer.
I added dynamic-highlight rules to lexer. please test, download 2 files Lua.*
https://github.com/Alexey-T/CudaText/tr ... ata/lexlib
Cud option must be set: lexer_dynamic_hilite
Well, I already had "lexer_dynamic_hilite" set to true and so had high hopes that the lexer would then do something like that... and now it does! I will have to play around with it a little (and set a better BracketBG ;) ) but it looks not bad at all.
Alexey wrote:1. TabSwitcher dialog. not a good idea, now we have order of lines from last actiavated time of each tab, so Ctrl+Tab n times (with holded Ctrl)--> n steps back
https://wiki.freepascal.org/CudaText#Tab_switcher
That's fine, either I can write a plugin that shows the files in a listbox in the tab display order or I will get used to it. :D :D

A great Thank You for your continued help and patience. 8-)

Posted: 08.06.2020 10:28
by Alexey
Thank you too, suggestions (most) are valid, bugreports too

Posted: 08.06.2020 10:43
by tmsg
Re the dynamic lexing... possibly a small correction: in Lua.cuda-lexmap you have "CurBlock BG=BracketBG" (note the blank in CurBlock BG). In the .lcf you also refer to "CurBlock BG". There seems to be a CurBlockBG (no blank) already defined... so I have replaced all "CurBlock BG" in the .lcf file with "CurBlockBG" and changed the .cuda-lexmap to read "CurBlockBG=CurBlockBG". Seems to work and means that I can have a BRIGHT RED BracketBG and a slightly less in-your-face CurBlockBG.

Posted: 08.06.2020 11:34
by Alexey
hm, name in the .lcf has no meaning (actual used style is in the .cuda-lexmap).
and 2) "CurBlockBG" actual style is for big sel blocks, not for one word...

Posted: 08.06.2020 11:38
by Alexey