User forums > Using Code::Blocks

New Folding Issue

<< < (3/5) > >>

kidmosey:

--- Quote from: Vampyre_Dark on July 22, 2006, 11:36:11 pm ---I also think like the above poster, that the last brace should be visible.

--- End quote ---

But then the fold could take upto 3 lines, two of which would usually be blank (except for braces).


--- Code: ---+ class CDolphin: public fish
  { // A dolphin class
  };
-------------------------------------------------------

+ struct TShark
  {
  };
-------------------------------------------------------

--- End code ---

At first glance, they just look like empty declarations.  Personally, I think both braces should be left out.  At any rate, I'm not sure if this is a C::B issue or a scintilla issue.

PhyloGenesis:
>At first glance, they just look like empty declarations.

? No, it should look like this (the line would go where the missing code is).


--- Code: (cpp) ---+ class CDolphin: public fish
  { // A dolphin class
-------------------------------------------------------
  };

+ struct TShark
  {
-------------------------------------------------------
  };
--- End code ---

Where is the source code for the folding?  (I'll check it out.)

kidmosey:

--- Quote from: PhyloGenesis on July 23, 2006, 09:28:20 am ---No, it should look like this (the line would go where the missing code is).


--- Code: (cpp) ---+ class CDolphin: public fish
  { // A dolphin class
-------------------------------------------------------
  };

+ struct TShark
  {
-------------------------------------------------------
  };
--- End code ---

--- End quote ---

Ahhhh, okay... Yeah, that makes a bit more sense.


--- Quote from: PhyloGenesis on July 23, 2006, 09:28:20 am ---Where is the source code for the folding?  (I'll check it out.)

--- End quote ---

I did a quick search in SVN.

file: /src/sdk/cbeditor.cpp
line: 1290

I'd start there.

sethjackson:

--- Quote from: kidmosey on July 23, 2006, 10:19:02 am ---
--- Quote from: PhyloGenesis on July 23, 2006, 09:28:20 am ---No, it should look like this (the line would go where the missing code is).


--- Code: (cpp) ---+ class CDolphin: public fish
  { // A dolphin class
-------------------------------------------------------
  };

+ struct TShark
  {
-------------------------------------------------------
  };
--- End code ---

--- End quote ---

Ahhhh, okay... Yeah, that makes a bit more sense.


--- Quote from: PhyloGenesis on July 23, 2006, 09:28:20 am ---Where is the source code for the folding?  (I'll check it out.)

--- End quote ---

I did a quick search in SVN.

file: /src/sdk/cbeditor.cpp
line: 1290

I'd start there.


--- End quote ---

You may want to check out the wxScintilla sources too.......

PhyloGenesis:
If any of the developers are willing:
To change the folding feature to not fold the closing brace simply


File: /src/sdk/cbeditor.cpp
Line: 1280-1284

change:
if (expand)
  m_pControl->ShowLines(line + 1, maxLine);
else
  m_pControl->HideLines(line + 1, maxLine);

to:  (just remove the " + 1")
if (expand)
  m_pControl->ShowLines(line, maxLine);
else
  m_pControl->HideLines(line, maxLine);


If there are residual problems, (such as the folder no longer finds the close brace) let me know, I'll do a more detailed check and get back on how to do it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version