bad autocompletion when standardize code is checked

can some of you please check <> ?
does it happens to someone else ?

this happens only with “standardize format” active in xojo preferences.
I press shift-return after I press each zero.

I just tested this with 2018r3 and 2018r2 and I can’t reproduce it. In fact it behaves different than your GIF:

if i>0

then Shift+Enter and I get:

If i>0 Then

and yours add a space between i and > and another between > and 0.

Are you sure you are not using some script?

Edit: What I see (macOS)

Yes, I can make it happen, its an old bug, there’s are a few of them for code reformatting and shift+enter errors.

<> covers it, but I added a comment for a beta so its only visible to xojo, you can’t see me talking about it :frowning: It’s still there in 2018r3. Here’s a quote form the hidden comment (as its now out of this beta):


if a=1<shift+enter>

and you end up with

If a =1 Then

End If

Now type the following without moving the cursor:

if a=1<shift+enter>

and you end up with

If a = 1 Then
If a = Then
End If

The 1 is split down a line and the extra End If isnt placed.[/quote]

<> adding the incorrect closing tag
<> code corruption after an undo of a piece of reformatted code (this is actually really hard to notice if you’re not paying attention when undo’ing code)

@Alberto De Poo : you must check “standardize format” in the xojo prefs (code pane) for it to happen.

I have this:

Do I need to change anything?

so there is something I have and Julian too, that you don’t have Alberto, that makes this error…
just have to find it, it is very annoying for me.

if I uncheck “apply standardize format” then I have a normal behavior.
I’ve tried to change the font, the size, reset the theme. still the same.

I am using macos 10.11.6 and xojo 2018r3. what are you both using ?

Jean, do you have a reformat code script installed inside your scrips folder in xojo?

If so you’ll need to remove it, or just remember to pad your code with spaces so the length doesnt change when you shift+enter, or just live with it until its fixed.

I have some scripts in this folder (and the “ReformatCode.xojo_script”) but I don’t use them.
I use the rcent integrated IDE standardize format feature.

edit: just removed this script and it’s still the same …

Did you restart the IDE after you removed the script?

whaou it works !
how the hell can this reformat script be launched as I did not ask for it ?

Glad we got to the bottom of that :slight_smile: Its not in there by default, you might have downloaded it at some point and forgotten about it. The fact that its loaded only happens because its placed there and the option is checked in the IDE that was mentioned earlier.

That’s why I put the video up, is not standard behavior for Xojo to add space between i>0. Glad you found the culprit.

I downloaded this script on purpose some times ago, but I was certain you had to select it in the script menu to launch it.
that it did not have anything to do with the integrated IDE standardize format.

The integrated IDE standardize format is replaced/overridden by the existence of a script called ReformatCode.xojo_script. It applies the formatting defined inside the script rather than the standard provided by the IDE so you can do things like this which aren’t supported in the standard IDE via the standardize format checkbox. You can find out more about it here

wel, Julian, in fact, I really liked your “ReformatCode.xojo_script”
very nice to format the code on the fly.
and the formating from xojo IDE is not formatting the code like I would.

there is really no way to make ReformatCode.xojo_script work with current Xojo ?

Unfortunately not, the insertion of the Then is being placed at the location it was meant to be before the new spacing is calculated so it ends up at the wrong position, everything else after that is then pushed to the next line. It seems like a pretty simple issue. but I guess its not as its not been fixed yet.

The problem is also there with the much simpler script in the xojo docs so its definitely not my script that’s causing the issue which means I can’t fix it, we just have to wait :frowning: