Whenever I'm just typing some code in Eclipse, and I click on the Error lightbulb on the gray ribbon area, my code just runs away from me, and I have to close the file and re-open it to see my code again. Can someone help me figure out how to STOP this? Thanks
4 Answers
Please follow these steps (I am running eclipse on MAC) to fix XML problems. You later commented it was a java file but actually java files are okay with me.
- Open Eclipse
- Open menu eclipse->preference or file->preference (windows version I am guessing)
- In the left pane expand the following nodes XML->XML Files->Editor
- Please take a look @ the following image and make sure yours has the same settings and hit apply.
- The problem is gone but you cannot add blank lines in the XML files any more.
You could be accidentally invoking code folding.
Does your editor show you something like this?
The red arrow (added for emphasis) points to a minus sign in a circle. When you hover over the area underneath the minus sign, a vertical bar is drawn from the minus sign to the bottom of the code block, of which the minus sign is next to the top line.
If you (perhaps accidentally) single-click on the minus sign or double-click on the vertical bar, then the whole block of code collapses and only the first line is shown. The minus sign changes to a plus sign. Clicking on the plus sign expands your code again.