NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Folding long strings


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Hello,

I would like to ask to add strings folding feature. Sometimes string takes up to the 10 lines of file and I think their folding will be useful. Here is two simple examples:
Code:
$query = "
  SELECT
    [something here]
  FROM
    [something here]
  WHERE
    [something here]";

or
Code:
$table = "
  <form name="form1" method="post" action="">
    <input type="text" name="textfield">
    <input type="submit" name="Submit" value="Submit">
  </form>";

May be this could be done with exist features; if so please give an example.

Thank you in advance
View user's profileFind all posts by DelphiSend private messageICQ Number


Joined: 14 Jun 2007
Posts: 67
Reply with quote
Simply select the text you wish to fold, then click the [-] button in the gutter.
View user's profileFind all posts by CjungeSend private message


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Cjunge wrote:
Simply select the text you wish to fold, then click the [-] button in the gutter.

Thank you, but of cause I know about folding the selected text Smile The problem is that it takes some time to select whole text (sometimes SQL requests take up to two screens Wink on 1600x1200 resolution) and I should do it every time I have modified it.

So that is why I have required this feature. I think it is not difficult to add it once and save hours of developers time (as well as "switch case", now I have habituating myself to add extra {} as I was suggested, but that is not too much comfortable)
View user's profileFind all posts by DelphiSend private messageICQ Number


Joined: 28 Mar 2007
Posts: 53
Reply with quote
As the other way I can suggest you to add shortcut for full string selecting where cursor is. So in this case developer will use this with combination of code folding shortcut to fold full string quickly Smile I think this should be easier to realize.
View user's profileFind all posts by DelphiSend private messageICQ Number
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Quote:
The problem is that it takes some time to select whole text (sometimes SQL requests take up to two screens Wink on 1600x1200 resolution) and I should do it every time I have modified it.


I don't want to sound like a know-all, but I personally find strings that exceed screen width a very bad programming practice. In general I try to keep my code-lines to a maximum of 132 characters. Is there any reason you aren't using HEREDOC to split the queries over multiple lines?
Besides it being easier to detect errors and find the correct spot to modify them a lot faster, it also involves a lot less scrolling Smile

As for the "selecting the whole text", you know you can use Shift+End to select until the end of the line, right? Wink
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I'm not sure if I have something special turned on in 5.2 5220 that I'm running, but it shows [+] and therefore lets me fold multi-line strings even with no selection.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
dmitri wrote:
I'm not sure if I have something special turned on in 5.2 5220 that I'm running, but it shows [+] and therefore lets me fold multi-line strings even with no selection.

Is that your special way of telling us you sneakily added that functionality in the last build or was it already there and I just looked over it? Smile
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I'm not sure what build introduced this change. It definitely works this way in 5.2 5220 and did not work this way in 5.0 (may be I'm wrong with last statement).

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Jun 2007
Posts: 67
Reply with quote
dmitri wrote:
I'm not sure what build introduced this change. It definitely works this way in 5.2 5220 and did not work this way in 5.0 (may be I'm wrong with last statement).

Nice!
View user's profileFind all posts by CjungeSend private message


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Quote:
I'm not sure if I have something special turned on in 5.2 5220 that I'm running, but it shows [+] and therefore lets me fold multi-line strings even with no selection.

Thank you very much I will update PhpED today

Quote:
Is there any reason you aren't using HEREDOC to split the queries over multiple lines?

Thank you for good suggestion. Of cause there is Smile To be honest I do not remember what was the reason why I am not using it any more but when I started to use it I came across with problems and restrictions, so I move back to simple double quotation marks. I will try to remember what kind of problem I came across and post it here.

Quote:
As for the "selecting the whole text", you know you can use Shift+End to select until the end of the line, right?

For sure Wink and ctrl+shift+end for until the end of the document Smile but in my case I have more than one line so I have to move down with holding shift key down ... anyway based on Dmitri's words that feature was fulfilled in 5220 release Wink

Once again thank you all for you time and help Smile
View user's profileFind all posts by DelphiSend private messageICQ Number
Folding long strings
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic