Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Close brace } put at the wrong indent level in new SC IDE editor #578

Closed
totalgee opened this Issue · 15 comments

6 participants

@totalgee

When I type a new close-brace } it doesn't put it at the right indent level… I'd like it to move back one level (as it does in the SC IDE), but it puts it at the same level. Note that it does do the "right thing" if I subsequently choose "Edit -> Autoindent Line or Region", or if I press tab after writing the character. But is it normal that I should have to do this?

if(true) {
    "hello".postln;
    }; // yuck

This looks vaguely related to issue 409, but that's closed…

@totalgee

Tim Blechmann wrote (on sc-users):

hm, typing the closing bracket in your example reduced the indentation
so that it looks like this for me:

if(true) {
"hello".postln;
};

which is what we indended ... is it different on your machine?

Yes, it's different. If I type the above text from scratch, the bottom brace is lined up below the opening quote of "hello". If I subsequently press tab (or do Autoindent from the menu), it gets put in the right place, directly below the if as in your example above.

@jleben
Owner

I can't reproduce that here, on Linux, KDE.

@telephon
Owner
@jleben
Owner

Btw, note also the space char before the "if(true)", which is not visible in the editor, but appears when you copy and paste text.

What do you mean? That you inserted that space, or that it's auto-inserted? Do you think that space would affect the indentation? It wouldn't / shouldn't / doesn't - here.

@telephon
Owner
@lijon
Owner

I can't reproduce this with latest git on OSX.

@telephon
Owner
@lijon
Owner

It indents correctly here, OSX 10.8. Perhaps it's a difference in language/locale settings? We've seen strange differences caused by this before.. I have my system language set to English.

@totalgee

Yes, good thought -- I just tried that out, and indeed: if I set my keyboard input to Canadian (English), it indents correctly. When my keyboard is set to its default (Spanish ISO), I get the indent problem...a clue! (hopefully, for someone ;-)

So not my language (my OS language is set to English), but the keyboard input device. In fact, I can leave the SC editor open, switch between English and Spanish keyboards, and the indent behaviour changes each way.

@telephon
Owner
@jleben
Owner

Is this still an issue?

@jamshark70
Owner

I can confirm it is still an issue. Linux, gnome. Just updated SC-IDE from git today.

@jleben
Owner

I believe the master branch should be fixed now.

The master and 3.6 have diverged in this section of code though, so I sent a patch for 3.6 to the mailing list. Can someone please test it?

@jleben
Owner

Has the patch for the 3.6 branch been tested?

@sofakid sofakid referenced this issue from a commit in sofakid/supercollider
@jleben jleben sc ide: fix auto-indenting closing brackets on certain locales
Fixes #578.
f4b2856
@scztt scztt added the bug label
@scztt
Owner

Fixed.

@scztt scztt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.