code collapse bug

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

code collapse bug

Post by blepore »

When one enables code collapse, if you collapse an if condition it does not just collapse the if statement, but it also includes the else code in the collapse. Consider the following type of PHP code.

Code: Select all

if (true) {
   echo 'true';
} else {
   echo 'false';
}
If the else condition is on the same line as the collapse, I would be okay with just collapsing the text between the if and the closing bracket, leaving the bracket where it was.
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: code collapse bug

Post by Gatis »

At the moment this is the intended behaviour at least until majority of customers shall ask for other implementation of this feature.
The same functionality is used also in some other editors that support code collapse. For example, Notepad ++.
Kind regards,
Gatis Avots
User avatar
joemichaud
Posts: 39
Joined: Sat Sep 29, 2007 4:58 pm

Re: code collapse bug

Post by joemichaud »

Sorry to contradict, but I actually prefer it the way it is now.
Joe Michaud
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Re: code collapse bug

Post by syrupcore »

joemichaud wrote:Sorry to contradict, but I actually prefer it the way it is now.
me too.
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

Re: code collapse bug

Post by blepore »

Gatis wrote:At the moment this is the intended behaviour at least until majority of customers shall ask for other implementation of this feature.
The same functionality is used also in some other editors that support code collapse. For example, Notepad ++.
Oh I did not mean to come off like I believed this was a bug. My hope was to have an option to change this type of behavior, because it doesn't seem to make much sense to me. When I want to hide a portion of code from view I would like to only hide the current block. To me it feels like the if and the else should be considered separate blocks to be collapsible. It's been a while since I've used an editor with this feature, but I know that this is the Dreamweaver 8 method of collapsing.

I fully understand the need to listen to your customer base. This isn't a make or break feature for me. Just would be nice. I'd be much happier for better JSON support, but that's a whole nother post. :)
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

Re: code collapse bug

Post by blepore »

Just for clarities sake, I meant the DW8 method was the way I was suggesting, not the way it is done presently. Would be nice to toggle it on with an option but I more than fully understand the purpose in only offering one way of doing things.
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: code collapse bug

Post by Gatis »

Tanks for your explanation, blepore. Sorry if I sounded rude.
Well, I have not used Dreamweaver myself, so I do not not how did they implement this. The problem I see here is that the closing mark of a block - '}' and also the opening one - '{' are on the same line.
Right now the code is collapsed including the last line where '}' is. Because of this it is not possible to have the same line with opening mark '{' being visible.
We would have to implement another complicated code collapse algorithm and also add an option.
Until substantial count of customers will be asking for this, we shall concentrate on improving or adding features that are more important.
Kind regards,
Gatis Avots
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

Re: code collapse bug

Post by blepore »

Gatis wrote:Tanks for your explanation, blepore. Sorry if I sounded rude.
Well, I have not used Dreamweaver myself, so I do not not how did they implement this. The problem I see here is that the closing mark of a block - '}' and also the opening one - '{' are on the same line.
Right now the code is collapsed including the last line where '}' is. Because of this it is not possible to have the same line with opening mark '{' being visible.
We would have to implement another complicated code collapse algorithm and also add an option.
Until substantial count of customers will be asking for this, we shall concentrate on improving or adding features that are more important.
Oh, I did not feel that you were being rude. I completely understand the need to keep things simple.

Basically the DW8 method is to always leave the }. Even if there is nothing on the line after the }, or if the } is on the same line as the { the collapsing just collapses the content within the braces, but not the braces.

I tried to upload an attachment to show what I meant, but I'm getting "Could not upload attachment to ./files/3189_af30598cc70f315a7181122e75626661.". Ahh well.
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: code collapse bug

Post by chrisjlocke »

Email me the attachment and I'll host it for you, if needed. :)
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

Re: code collapse bug

Post by blepore »

chrisjlocke wrote:Email me the attachment and I'll host it for you, if needed. :)
Oh I've got enough hosting. What is the policy on posting pictures on this forum? I figured that attachments were down I thought they were disabled and thus I should link anything.
Post Reply