Control+I in IDE messes up alignment of semicolons in inline Javascript

Just starting out? Need help? Post your questions and find answers here.
Quin
Posts: 118
Joined: Wed Nov 08, 2023 4:38 pm

Control+I in IDE messes up alignment of semicolons in inline Javascript

Post by Quin »

If I have semicolons at the end of a bunch of javascript lines, like this, selecting all the code and pressing control+I aligns the semicolons like so:

Code: Select all

    EnableJS
    synth = window.speechSynthesis;
    aria = document.createElement("div");
    aria.id = "speech"                  ;
    aria.style = "position: absolute; left: 0px; top: -400px";
    aria.setAttribute("aria-live", "assertive")              ;
    document.body.appendChild(aria)                          ;
    DisableJS
Is this intended? I think not; probably a side effect of comments being a semicolon.
Quin
Posts: 118
Joined: Wed Nov 08, 2023 4:38 pm

Re: Control+I in IDE messes up alignment of semicolons in inline Javascript

Post by Quin »

I just tested, and this seems limited to EnableJS/DisableJS blocks; using the ! before every line doesn't do it.
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Control+I in IDE messes up alignment of semicolons in inline Javascript

Post by Fred »

IN JS block, you should only use '!' lines when writing javascript code. HTML tags can be put without the '!'. I added a note in the documentation.
Quin
Posts: 118
Joined: Wed Nov 08, 2023 4:38 pm

Re: [Done] Control+I in IDE messes up alignment of semicolons in inline Javascript

Post by Quin »

Oh, interesting. I see. Thanks Fred!
Post Reply