XYS Syntax Highlighting/Autocomplete for Akelpad [XY v25.90]

Discuss and share scripts and script files...
ren326
Posts: 4
Joined: 01 May 2024 10:02

Re: XYS Syntax Highlighting/Autocomplete for Akelpad [XY v25.90]

Post by ren326 »

Hi Flux,

pleased you liked my suggestion.
Same idea to highlight function name :

QuotesRE:
;==========================================================================
;Flags Pattern \BackRef=(FontStyle,ColorText,ColorBk) \BackRef=...
;==========================================================================
0 "(function)\s+(.+$)" "\1=(0,${IF},0) \2=(2,0,#0000FF)"

Bonne journée.

ren326
Posts: 4
Joined: 01 May 2024 10:02

Re: XYS Syntax Highlighting/Autocomplete for Akelpad [XY v25.90]

Post by ren326 »

ReHi,

better RegExp to isolate function name :

0 	"(function)\s+(.+\))\s+\{$"                	"\1=(0,${IF},0) \2=(2,0,#0000FF)"

ren326
Posts: 4
Joined: 01 May 2024 10:02

Re: XYS Syntax Highlighting/Autocomplete for Akelpad [XY v25.90]

Post by ren326 »

A little script to help decode highlight "flags values"
Copy + paste in a .js file under AkelPad\AkelFiles\Plugs\Scripts
Useful for me, maybe for you ?

Code: Select all

// Select flag value and call script.

var pSelText=AkelPad.GetSelText();
var nResult=0;
var flag=[];

flag[1]		= "case sensitive";
flag[2]		= "word is a composition of chars";
flag[4]		= "QE required";
flag[8]		= "QS is ignored, use last met delimiter as QS";
flag[16]	= "QE is ignored, use first met delimiter as QE";
flag[32]	= "don't highlight QS";
flag[64]	= "don't highlight QE";
flag[128]	= "don't catch and don't highlight QS";
flag[256]	= "don't catch and don't highlight QE";
flag[512]	= "QS, delimiter or word is at line start";
flag[1024]	= "QE, delimiter or word is at line end";
flag[2048]	= "QS is surrounded with delimiters";
flag[4096]	= "QE is surrounded with delimiters";
flag[8192]	= "quote doesn't contain delimiters";
flag[16384]	= "only QS string is catched";

if (pSelText) {
    nResult=DeSum(pSelText);
    WScript.Echo("[ QS/QE : Quote Start/End ]\n\n"+pSelText + " (sum of)" + nResult);
}
else {
    WScript.Echo("No value selected !");
}

function DeSum(value) {
    var b=1;
    var res=[];
    while (b<=value) {
	if (b&value) res.push("\n"+b+"\t : "+flag[b]);
	b<<=1;
    }
    return res;
}

FluxTorpedoe
Posts: 862
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomplete for Akelpad [XY v25.90]

Post by FluxTorpedoe »

@Horst
Thanks for the feedback, it’s always welcome! 😎

@ren
Interesting script for Akelpad, thanks!
Also, the highlight for function declarations could be a nice touch too (even though less useful in my case, I declare them at the bottom of my scripts).

@all
To make the new highlight for script captions more customizable, I tried to use theme variables instead of fixed colors, but obviously it depends on everyone’s theme. I may set it as default in the next update, so tell me if that would work for you.

Replace the active caption highlight after "; Quotes",
Default:

Code: Select all

517 1 #FFF #40639A `"` `"` "" "" "-"
with this:

Code: Select all

517 1 ${HighLight_CaretColor} ${ATTR} `"` `"` "" "" ""

Post Reply