I have been working with Java in an Eclipse IDE. I can type every single character just fine except for the '{' character. I need to resort to Ctrl+c and Ctrl+v every single time when I want to create a new block of {}.
In the Window>Preferences>Editor>Typing Braces are on, and they autocorrect just fine after I manage to copy a {.
Outside eclipse, in a text editor, or even in this question, I can type { by hitting Atl Gr + B, so I am thinking the problem is inside Eclipse.
Any help would be really appreciated, this error is getting quite annoying.
The simplest and global way: Go to Window -> Preferences. Then in search put: "brace". Select -> Java -> Code Style-> Formatter After opening new window go to brace tab and change it as you prefer.
If it is a windows keyboard you can do (alt+123) for '{' and (alt+125) for '}'. On a Mac the shortcuts are (shift + alt + 8) for '{' and (shift + alt + 9) for '}'.
Always include curly brackets. Always include curly brackets, even for one-line if statements or for loops. Java has a "feature" which allows you to omit curly brackets when writing if statements, for loops, or while loops containing only a single statement.
To see a bracket's pair, click to the right of the bracket. Its matching pair will be highlighted. To jump to the matching bracket, press Ctrl+Shift+P.
The problem is with the skip breakpoints option. After unbinding the Alt+B key command, try to unbind the Ctr+Alt+B (skip brakepoints).
This solved my problem. If you try to type the "{" you can see the skip breakpoint option flashing.
Go Windows-> Preferences type in search field 'binding' click on Keys, look up for Alt+B, click on it and then click Unbind Command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With