Page 5 of 6

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 30 May 2021 17:02
by wenmin92
Thanks, very useful.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 30 May 2021 18:26
by Horst
Thanks for the ongoing maintenance.
I switched my Editor from SynWrite to Akelpad at the time I started with XY.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 30 May 2021 18:30
by wenmin92
How can I quickly comment/uncomment one/multiple lines? Is there something like Ctrl+/?

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 30 May 2021 23:52
by Horst
wenmin92 wrote: 30 May 2021 18:30 How can I quickly comment/uncomment one/multiple lines? Is there something like Ctrl+/?
In the archive at
http://akelpad.sourceforge.net/forum/vi ... mment+line
there is a script toggleComments.js which may help.
I didn't had the time to check it, it must be customized to support xys scripts.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 31 May 2021 02:21
by wenmin92
Horst wrote: 30 May 2021 23:52 In the archive at
http://akelpad.sourceforge.net/forum/vi ... mment+line
there is a script toggleComments.js which may help.
I didn't had the time to check it, it must be customized to support xys scripts.
Thank you very much for your replies and reminders, which saved me a lot of time.
Very few changes are required, except to add xys: "c", to the CommentsSets object.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 31 May 2021 09:16
by Horst
wenmin92 wrote: 31 May 2021 02:21
Horst wrote: 30 May 2021 23:52 In the archive at
http://akelpad.sourceforge.net/forum/vi ... mment+line
there is a script toggleComments.js which may help.
I didn't had the time to check it, it must be customized to support xys scripts.
Thank you very much for your replies and reminders, which saved me a lot of time.
Very few changes are required, except to add xys: "c", to the CommentsSets object.
Glad to helped.
I'm still learning a little bit more about customizing AkelPad.
For interest what other changes did you made to the script ?

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v21.60]

Posted: 31 May 2021 09:50
by wenmin92
Horst wrote: 31 May 2021 09:16 Glad to helped.
I'm still learning a little bit more about customizing AkelPad.
For interest what other changes did you made to the script ?
I didn't check the other parts. I just added support for the .xys file based on my guess, and then tried it. Fortunately, the result proved feasible.
Image

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 14:33
by FluxTorpedoe
Hi everyone,

First, thanks for the feedback! :)
And for the links and tips. :tup:

I just updated the file to XYplorer v22.70 (link to file and configuration tips available in first post).

Features:
 — Changes from 21.60
   (15 new commands, plus get(parameters), other changes, and a few fixes)

Have a nice day, 8)
Flux

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 15:34
by Horst
Thanks for keeping this up again.

Btw. my point to the discussion which is the better editor (PSpad or Akelpad).
Try to select a column block in both editors and hit the tab key to indent this block.
Akelpad indents as one could expect.
PSpad and many other editors miserably fails and deletes part of the block.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 18:32
by klownboy
Thanks, from me as well Flux. I hope all is well.

A question on Akelpad recognizing starting and closing curly brackets "{" and "}". Honestly I have no idea if it has to do with syntax highlighting or an issue with Akelpad itself. I've run across this a number of times in scripts where for some reason Akelpad is not picking up a particular starting curly bracket so the closing one is incorrect or the proper one is not recognized. Have you or Horst came across this? After putting this in Akelpad, if you click of the starting curly bracket after the foreach, the closing one should be way down at the end. Instead it's the closing one for the first "if" statement. It's as if the Akelpad is not recognizing the starting curly bracket after the "if" statement. I tried all types of formatting and it's still incorrect. The script works fine. Here's an example. Thanks again.

Code: Select all

		foreach ($ea_path, $paths, <crlf>, "e") {
			if (substr($ea_path, -1) != "\") {
				$ea_path = $ea_path . "\";
			}
			goto $ea_path;   // experienced issues using a path with filelist.txt within the montage cmd line, so moving into each folder
			if(exists($ea_path . "folder.jpg")) {
				attrstamp("h", 4, $ea_path . "folder.jpg");
				delete 0, 0, $ea_path . "folder.jpg";
			}
			$image_list = formatlist(folderreport("files", "r", "$ea_path", , , <crlf>), "f", <crlf>, "*.jpeg<crlf>*.jpg<crlf>*.bmp<crlf>*.png<crlf>*.mp4<crlf>*.mov<crlf>*.wmv<crlf>*.avi<crlf>*.pdf");
			$i = gettoken($image_list, "count", <crlf>);
			if ($i >= "4") {$count = 4; $geometry = "720x720"; $tile = "2x2";}
			elseif ($i < "4") {
				$continue = confirm("This folder [$ea_path] does not contain enough image files to make a proper folder montage.<crlf 2>" .   quote("Yes") . "  to contnue with script [since other sub folders may contain images], or<crlf 2>" .   quote("No") . " to exit script now.", <crlf>,1,4);
					if($continue=="1"){continue;}
					elseif($continue=="0"){end 1;}
			}
			$random_images = GetToken(formatlist($image_list, 'x', <crlf>), $count, <crlf>,, 1);     //randomize the no of images "$count" in $image_list
			$i = 1;
			$final_images = "";
			foreach($image, $random_images, <crlf>, "e") {
				savethumb($image, "p_i_c_$i.jpg", $thumbsize_X,, "jpg100", "4", 2);   //border of "4"
				$final_images .= "p_i_c_$i.jpg" . <crlf>;
				$i++;
			}
			$final_images = trim(regexreplace($final_images, "^(.*\\)(.*?$)", "'$2'"),<crlf>, "r");
			writefile("filelist.txt", $final_images);
			$folder_name = quote(getpathcomponent($ea_path, "component", -1));
			run """$montage_exe"" @filelist.txt -geometry $geometry-1-1 -auto-orient -tile $tile $folder_name folder.jpg", , 2,0;
			delete 0, 0, $ea_path . "filelist.txt";
			delete 0, 0, $ea_path . "p_i_c_*";
			sub "_ViewPic";
			attrstamp("h", 1, $ea_path . "folder.jpg");      //if you'd rather not hide the folder montage comment out this line
		}

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 20:09
by Horst
I see the same problem.
Also the range on the left side is showing it wrong and the XBrackets plugin makes the same error.
I guess it comes from the XYS coder.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 20:52
by klownboy
Thanks Horst for confirming. I'm quite sure this is where I've seen this happen before - with some combination of foreach and if conditions.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 21:02
by FluxTorpedoe
   Thanks for the feedback!
   :)

   Regarding the brackets detection problem, I’ve narrowed it down to… the "/" in the first if() ! 🤔
   If you replace eg. with: if (substr($ea_path, -1) != "/") {
   The brackets detection works correctly !

   It may be related to the word boundaries detection then…
   I’ll investigate.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 13 Jan 2022 22:13
by klownboy
Thanks Flux for checking it out. It wasn't that big a deal, but when it does happen you end up wasting some time trying to figure out what you did wrong. There are enough times when I did do something wrong.

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v22.70]

Posted: 14 Jan 2022 12:04
by FluxTorpedoe
   Ok, so it was related to code folding and irrelevant escape characters in what should be skipped.
   (eg. if you have a } in a "string" or //comment)

   I think the whole Skips section can be cleaned up.
   Just to be on the safe side, I’ll test more thoroughly before posting the fixed file.
   For those who want to give it a try, just replace the whole Skips section in xys.coder with this one:

Code: Select all

Skips:
;=============================
;Flags  Skip    Skip    Escape
;       start   end     char
;=============================
1	`"`	`"`	""
1	`'`	`'`	""
1	"//"	""	""