Good news...

Post Reply
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Good news...

Post 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.
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post 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-)
Last edited by tmsg on 08.06.2020 14:43, edited 1 time in total.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Thank you too, suggestions (most) are valid, bugreports too
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post 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.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post 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...
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Post Reply