[BUG] Incorrect Folding Marking in C files

General questions regarding the usage of CodeLite
User avatar
eranif
CodeLite Plugin
Posts: 5983
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [BUG] Incorrect Folding Marking in C files

Post by eranif » Thu Aug 21, 2008 10:02 am

You should read the change log more carefully ...

The folding that you are seeing are called 'Compact' which means: "dont stop folding at whitespace and fold as much as you can"
To enable/disable it, (and this is what I have implemented) -> Settings -> Editor -> Folding

There you will also find the other feature u have requested

Eran
Make sure you have read the HOW TO POST thread

hbr_in
CodeLite Expert
Posts: 113
Joined: Fri Jul 11, 2008 9:12 am
Contact:

Re: [BUG] Incorrect Folding Marking in C files

Post by hbr_in » Thu Aug 21, 2008 11:23 am

eranif wrote:You should read the change log more carefully ...

The folding that you are seeing are called 'Compact' which means: "dont stop folding at whitespace and fold as much as you can"
To enable/disable it, (and this is what I have implemented) -> Settings -> Editor -> Folding
Eran
Really Sorry. Just found it and felt very happy. Un-knowing i had chcecked fold compact.

But i couldnt find the explanation for Fold-compatc in changelog. it just says "enabled following options: fold for preprocessors, fold compact, fold at else"
So i thought it is something different & i checked it in preference.
eranif wrote: There you will also find the other feature u have requested
Eran
Thanks Very Much.

Fold at else doesnt work. Kindly paste the below code. Fold @ else doesnt work for preprocessor or for normal c code.

Code: Select all

#include <stdio.h>

#define TEST_DUMMY_PRE	1

#if (TEST_DUMMY_PRE)
#define	DummyTest	1
#else
#define	DummyTest	0
#endif

int main(void)
{
	
	int a = 1;

	if(a == 1)
		printf("a is 1\n");
	else
		printf("a is not 1\n");
	
	return 0;
}

Also, if i uncheck fold compact option, & check fold pre-processor option, Close Settings dialog & reopen Setting dialog->Folding, Fold Preprocessors is unchecked. And the same is vice-versa also. if Fold-Preprocessor un-checked & fold compact is checked, Closing & re-opening, fold processor is checked.

So is fold compact & fold preprocessor is mutually inclusive. Is it Intentional. Then i have no other option than to have Fold Compact option enabled & have whitespaces included.

Regards
Gururaja

hbr_in
CodeLite Expert
Posts: 113
Joined: Fri Jul 11, 2008 9:12 am
Contact:

Re: [BUG] Incorrect Folding Marking in C files

Post by hbr_in » Thu Aug 21, 2008 11:36 am

Hi,

Also regarding Fold Compact & Fold Pre-Processor, Even if Fold Preprocessor & Fold Compact is unchecked, code folding for Preprocessor works inside editor window. Try with earlier code for this testing.

Uncheck Fold Compact & Fold Preprocessor in editor settings->folding
[optional] close & restart Codelite.
[optional] Check again in editor settings->folding for unchecked fold compact & fold preprocessor

View the code attached in previous post

Regards
Gururaja

User avatar
eranif
CodeLite Plugin
Posts: 5983
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [BUG] Incorrect Folding Marking in C files

Post by eranif » Thu Aug 21, 2008 12:09 pm

hbr_in wrote:Fold at else doesnt work. Kindly paste the below code. Fold @ else doesnt work for preprocessor or for normal c code.
'Fold at Else' is a scintilla feature, and was never meant to work for preprocessors, only for C code.

You wont see it in the sample code you provided since, I dont know if you know this, scintilla's folding works for '{' '}'.

Try this code:

Code: Select all

#include <stdio.h>

#define TEST_DUMMY_PRE   1

#if (TEST_DUMMY_PRE)
#define   DummyTest   1
#else
#define   DummyTest   0
#endif

int main(void)
{

	int a = 1;

	if (a == 1){
		printf("a is 1\n");
	}else{
		printf("a is not 1\n");
	}

	return 0;
}
hbr_in wrote:Also regarding Fold Compact & Fold Pre-Processor, Even if Fold Preprocessor & Fold Compact is unchecked, code folding for Preprocessor works inside editor window
I noticed this one, it is a bug in the representation. The condition to check/uncheck the 'Fold Preprocessor' on startup is using the one of the 'Fold Compact' (you will notice that they are always in sync, either both checked on unchecked)

However, it does not affect the functionality. That is, what matters is their state while clicking the OK/Apply button - this is why it is still working.

Eran
Make sure you have read the HOW TO POST thread

User avatar
eranif
CodeLite Plugin
Posts: 5983
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: [BUG] Incorrect Folding Marking in C files

Post by eranif » Thu Aug 21, 2008 12:27 pm

eranif wrote:I noticed this one, it is a bug in the representation. The condition to check/uncheck the 'Fold Preprocessor' on startup is using the one of the 'Fold Compact' (you will notice that they are always in sync, either both checked on unchecked)

However, it does not affect the functionality. That is, what matters is their state while clicking the OK/Apply button - this is why it is still working.
This is now fixed in SVN (revision 2014)

Eran
Make sure you have read the HOW TO POST thread

hbr_in
CodeLite Expert
Posts: 113
Joined: Fri Jul 11, 2008 9:12 am
Contact:

Re: [BUG] Incorrect Folding Marking in C files

Post by hbr_in » Thu Aug 21, 2008 12:33 pm

eranif wrote:'Fold at Else' is a scintilla feature, and was never meant to work for preprocessors, only for C code.

You wont see it in the sample code you provided since, I dont know if you know this, scintilla's folding works for '{' '}'.
Oh OK now i got it. Thanks for clarification.

Regards
Gururaj

Post Reply