Scala editor annoyance on inserting braces

47 views
Skip to first unread message

Silvio

unread,
Jun 12, 2013, 5:30:32 AM6/12/13
to scala-i...@googlegroups.com
Hello all,

I recently switched from a 2.9.x nightly build to 2.10.2. When editing a line and putting a { (brace) inside the code the editor jumps to the end of the line and puts the brace there. This is reminiscent of earlier added automatic behavior regarding braces and brackets which after some complaints where put behind a setting in the Scala editor.

I really dislike this. If I want the brace at the end of the line I will put the cursor there. As it is now it is almost impossibe to get the brace where I want it. If (for debuging purposes) I want to change

option.foreach(goWith(_))

to

option.foreach({ println("BOO"); goWith(_) })

the editor does not allow me to put the opening brace in there. I could not find an option that allows me to disable this. Does it exist? If not, could it be added?

Cheers,

Silvio

Simon Schäfer

unread,
Jun 12, 2013, 7:35:42 AM6/12/13
to scala-i...@googlegroups.com
I can't reproduce the behavior neither with the actual stable nor with
the nightly build. I assume you are using 3.0.1-RC1, is this correct?

The behavior is inherited from Java and can be found in "Preferences →
Java → Editor → Typing → Actually insert at correct position". If you
disable this option the braces are not moved to the end. To get the
braces back to the correct position you can also hit backspace after it
is moved to the end.

Nevertheless, the braces shouldn't moved to the end in your use case,
thus it is a bug. Could you please file a ticket at
https://www.assembla.com/spaces/scala-ide/support/tickets?

Simon
>
> Cheers,
>
> Silvio
>
> --
> You received this message because you are subscribed to the Google
> Groups "Scala IDE User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to scala-ide-use...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Silvio

unread,
Jun 12, 2013, 9:27:47 AM6/12/13
to Scala IDE User


On 12 jun, 13:35, Simon Schäfer <m...@antoras.de> wrote:
>
> I can't reproduce the behavior neither with the actual stable nor with
> the nightly build. I assume you are using 3.0.1-RC1, is this correct?
>
> The behavior is inherited from Java and can be found in "Preferences →
> Java → Editor → Typing → Actually insert at correct position". If you
> disable this option the braces are not moved to the end. To get the
> braces back to the correct position you can also hit backspace after it
> is moved to the end.
>
> Nevertheless, the braces shouldn't moved to the end in your use case,
> thus it is a bug. Could you please file a ticket athttps://www.assembla.com/spaces/scala-ide/support/tickets?
>
> Simon
>

I do have that setting checked but that explicitly says "correct
position" so I did not expect that setting to cause this. It must be a
bug. The Java editor settings also include autmatic closing of braces,
brackets etc. all of which I have switched off. Nonetheless, the Scala
editor is closing everything now.

Are these separate bugs? I do not mind filing a tickets but I am
unsure if these should be filed as a single bug.

Cheers,

Silvio

Simon Schäfer

unread,
Jun 12, 2013, 9:41:14 AM6/12/13
to scala-i...@googlegroups.com

> I do have that setting checked but that explicitly says "correct
> position" so I did not expect that setting to cause this.
All settings on this page are auto edits which means that they are
automatically applied when you type.
> It must be a bug. The Java editor settings also include autmatic closing of braces,
> brackets etc. all of which I have switched off. Nonetheless, the Scala
> editor is closing everything now.
When braces are always closed, then you can disable the option "Scala →
Editor → Enable auto closing braces when editing an existing line".
>
> Are these separate bugs? I do not mind filing a tickets but I am
> unsure if these should be filed as a single bug.
It should be possible to control the smart semicolon and braces
functionality with settings of the Scala editor, thus yes this should be
filed as improvement.
>
> Cheers,
>
> Silvio
>

Reply all
Reply to author
Forward
0 new messages