Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Newline + Indenation after { and no closing brackets...
Newline + Indenation after { and no closing brackets... [message #162944] Sat, 05 June 2004 16:06 Go to next message
Eclipse UserFriend
Hello!

I configured the Java Editor some time before and now (when I used
Eclipse M8 again) I noticed that after typing a "{" and pressing Enter
there is no default indentation.
Furthermore my braces are not closed automatically.
Example:
I'm typing this in a class (<ENTER> means pressing Enter):


public void a() {<ENTER>
| C

My cursor goes to the marked position |, but I want it move to C.
It would be nice if the bracket { is closed automatically.
Example:

I write: public void a() {<ENTER>
and then } would appear in the line after my cursor at the same
indentation as the method signature.

It would result in:
public void a() {<ENTER>
|
}



I think I just messed up my configuration but I cannot find any wrong
settings.
It would be nice if you help, therefore:
Thanks in advance,
Hero Wunders
Re: Newline + Indenation after { and no closing brackets... [message #163015 is a reply to message #162944] Mon, 07 June 2004 05:02 Go to previous messageGo to next message
Eclipse UserFriend
The ususal suspects:

- You disabled smart insert mode (Edit->Enable Smart Insert Mode) - no
auto-indentation or auto-closing is done in this mode.

- Your editor preferences say not to close braces:
Java->Editor->Typing->Close Braces

- Your source around the typing area does not have balanced braces, so
your opening brace is actually matched to another one.

- Your formatter preferences say not to indent statements inside a
method body.

- You're on a mac and a tab is not displayed correctly.

HTH
-tom

Hero Wunders wrote:
> Hello!
>
> I configured the Java Editor some time before and now (when I used
> Eclipse M8 again) I noticed that after typing a "{" and pressing Enter
> there is no default indentation.
> Furthermore my braces are not closed automatically.
> Example:
> I'm typing this in a class (<ENTER> means pressing Enter):
>
>
> public void a() {<ENTER>
> | C
>
> My cursor goes to the marked position |, but I want it move to C.
> It would be nice if the bracket { is closed automatically.
> Example:
>
> I write: public void a() {<ENTER>
> and then } would appear in the line after my cursor at the same
> indentation as the method signature.
>
> It would result in:
> public void a() {<ENTER>
> |
> }
>
>
>
> I think I just messed up my configuration but I cannot find any wrong
> settings.
> It would be nice if you help, therefore:
> Thanks in advance,
> Hero Wunders
Re: Newline + Indenation after { and no closing brackets... [message #163054 is a reply to message #163015] Mon, 07 June 2004 13:14 Go to previous message
Eclipse UserFriend
Hello!

> - You disabled smart insert mode (Edit->Enable Smart Insert Mode) - no
> auto-indentation or auto-closing is done in this mode.

I pressed Insert on my Keyboard some time before...
When I tried Eclipse again after a restart everything was fine again :)

Hero Wunders
Previous Topic:Could not find the main class
Next Topic:JDT Java Elements
Goto Forum:
  


Current Time: Wed May 07 21:48:34 EDT 2025

Powered by FUDForum. Page generated in 0.02565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top