[FIXED] First line unindentation too aggressive?

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

[FIXED] First line unindentation too aggressive?

Post by Marco »

Code: Select all

    * Scripting: Now loaded scripts are automatically unindented, i.e. the first
      line's indent is removed from all lines. That way you can easier copy and
      paste scripts, e.g. from this change log, without the need to manually
      left-align the code blocks first.
However I have a script file that contains a single script. As such, the first line is indented as per long-time syntax rules. Now, loading it shows a popup menu where I can see the single lines of code, instead of working normally. Either this is a bug, or I should change my script-writing habits, I don't know…
Last edited by Marco on 10 Apr 2015 21:03, edited 1 time in total.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: First line unindentation too aggressive?

Post by admin »

Can you give an example? I don't remember a rule by which the first line of a script should be indented.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: First line unindentation too aggressive?

Post by bdeshi »

frankly this is ridiculous.

Code: Select all

 echo 'Hi';
 echo 'Hi';
 echo 'Hi';
No matter whether the lines have original 1-space indent or phpbb-supplied +4 spaces,
copy code and either ::load <clipboard>; or paste into Run Script.

:veryconfused:

more maddening: if the first line has more spaces than later lines, the folloing lines are cropped!

Code: Select all

  echo 'Hi';
 echo 'Hi';
 echo 'Hi';
becomes

Code: Select all

echo 'Hi';
cho 'Hi';
cho 'Hi';
:x
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: First line unindentation too aggressive?

Post by admin »

Looks like a little logic flaw... :whistle:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: First line unindentation too aggressive?

Post by bdeshi »

Please just undo the change. Correct indentation is and should remain Users' duty. XY is trying to be too clever and shooting itself in the knee. [I think that's more painful than injuring the foot] :blackstorm:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: First line unindentation too aggressive?

Post by klownboy »

When I mentioned cutting and pasting from the beta notes and receiving errors in the other thread, I wasn't expecting anything to be done to scripting. I didn't happen to see the note that stated the function line can not be indented. I'm used to having to adjust the line indents when cutting and pasting from the forum and have no problems doing that. :)

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: First line unindentation too aggressive?

Post by admin »

Okay, you all can relax now. :)

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: First line unindentation too aggressive?

Post by Marco »

Works as usual now, thanks :beer:
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: [FIXED] First line unindentation too aggressive?

Post by bdeshi »

thanks, Doc, the foot's better now. :wink:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: [FIXED] First line unindentation too aggressive?

Post by admin »

SammaySarkar wrote:thanks, Doc, the foot's better now. :wink:
Note that I fixed all the issues you mentioned, so you could as well tweak it on. I have done so.

Post Reply