Find the answer to your Linux question:
Results 1 to 6 of 6
I am new to eclipse and am having a hard time to find the function to expand or unexpand a block defined by {}. Could someone help me? Thanks....
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    3

    c++ code editing in eclipse help on expanding {}

    I am new to eclipse and am having a hard time to find the function to

    expand or unexpand a block defined by {}.

    Could someone help me?
    Thanks.
    Last edited by deqiangs; 04-21-2011 at 11:05 PM. Reason: clearer

  2. #2
    Just Joined!
    Join Date
    Dec 2009
    Location
    Maryland, USA
    Posts
    83
    I believe if a block of code is hidden, there is a '+' in the left column that, when selected, will unhide the hidden code. I'm not sure I understand your question, and I can't open Eclipse to verify what I'm telling you, so if I've gotten it wrong let me know.

  3. #3
    Just Joined!
    Join Date
    Apr 2011
    Posts
    3
    I believe what you said. But there's no such "+" for a block at default.
    Quote Originally Posted by GregBrannon View Post
    I believe if a block of code is hidden, there is a '+' in the left column that, when selected, will unhide the hidden code. I'm not sure I understand your question, and I can't open Eclipse to verify what I'm telling you, so if I've gotten it wrong let me know.

  4. #4
    Just Joined!
    Join Date
    Dec 2009
    Location
    Maryland, USA
    Posts
    83
    I've attached a pic of how Eclipse looks on my desktop. I'm using the Helios Java version, but I think the interface is the same.

    Note the '+' in a circle at line 30, the '-'s at lines 87 and 93. Clicking the plus will expand my list of imports. Clicking the minuses will hide the HOURS and MINUTES definitions.

    If you don't have the '+' and '-', I don't know what to tell you. You might try reinstalling. Or you may want to check the configuration option that enables code folding. Check under Window, Editor, Java (might be your language), Folding, and ensure that Enable Folding is checked. Then review the settings for those that are initially folded so as to not have things hidden by default that you don't want hidden.

    Good luck.
    Attached Images Attached Images

  5. #5
    Just Joined!
    Join Date
    Apr 2011
    Posts
    3
    Wonderful!
    I go to Windows, Preferences, C++, Editor, Folding, and found several options are not checked at default.
    Put checks in those option and I do get the small "-" for each for/if/subroutine blocks.
    Thanks very much.

    PS: I do not understand why this is NOT at default like other editors.


    Quote Originally Posted by GregBrannon View Post
    I've attached a pic of how Eclipse looks on my desktop. I'm using the Helios Java version, but I think the interface is the same.

    Note the '+' in a circle at line 30, the '-'s at lines 87 and 93. Clicking the plus will expand my list of imports. Clicking the minuses will hide the HOURS and MINUTES definitions.

    If you don't have the '+' and '-', I don't know what to tell you. You might try reinstalling. Or you may want to check the configuration option that enables code folding. Check under Window, Editor, Java (might be your language), Folding, and ensure that Enable Folding is checked. Then review the settings for those that are initially folded so as to not have things hidden by default that you don't want hidden.

    Good luck.

  6. #6
    Just Joined!
    Join Date
    Dec 2009
    Location
    Maryland, USA
    Posts
    83
    Glad to help and that you got it fixed. Eclipse is an excellent tool, but it definitely takes some time to get comfortable with it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...