NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How do I make auto-close brackets to work?


Joined: 23 Nov 2007
Posts: 2
Reply with quote
Hello!
I just installed the trial version and I have a question.
I thought that a code completion is supposed to automatically close brackets, single and double quotes and square brackets.

But I don't see this happening.

When I type for example foreach(
I expect the editor to automatically add the ')'
when I type $array[
I expect the editor to automatically add the ']'
But this is not happening.

The only auto-completion I see is that when I start typing the comment like this /**
then I see a closing */ automatically added.

What about closing the curly braces, brackets, single and double quotes?

Please help me with this.

Thank you.
View user's profileFind all posts by D.Smith1Send private message


Joined: 24 Oct 2006
Posts: 98
Location: Melbourne, AU
Reply with quote
Check your settings under 'editor settings' -> auto-close brackets.
View user's profileFind all posts by LatsSend private message


Joined: 23 Nov 2007
Posts: 2
Reply with quote
Thank you.
They were not enabled, I enabled it and now it works.

I think this should be enabled by default.
View user's profileFind all posts by D.Smith1Send private message


Joined: 05 Aug 2007
Posts: 32
Reply with quote
I would just like to chime in and say these don't work as I expected they would.

When typing a line of code that has many brackets or parenthesis, I know of no hotkey to skip over the auto-closed brackets so I figure typing them would be the next logical way to skip over them (other than the arrow keys). However, typing them again does not skip over them (like auto-close quotes) but rather inserts them.

This is happening on build 5219. Anyone else see this problem, or know the hotkey to skip over the auto-closed brackets?
View user's profileFind all posts by bpat1434Send private messageAIM AddressYahoo MessengerMSN MessengerICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8328
Reply with quote
well, if you got it right, there is no problems at all.
If you have a bracket on the right of the cursor and you type the same bracket, why would it be skipped/swallowed? Is there any reason for this?
For example:
say, you have
|]

and then you type ]

why would it get
]|
and not ]|]

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


Joined: 05 Aug 2007
Posts: 32
Reply with quote
Okay, let me counter you and say this: If you got auto-close brackets right, wouldn't the same exact functionality be expected of auto-close quotes? So why is it that when you have that enabled, and you have say:

$var = 'This is a string with an auto closed quote|'

The "|" being where the cursor is.

Then you press the quote key, it skips over it. It does this even inside other quoted strings. So by your thinking, either the auto-close brackets are right, and the quotes are wrong, or the quotes are right and the brackets are wrong. Which one is it?

I only bring this up because almost every other piece of software that has auto-closing quotes & brackets behaves the same way. You can skip over them if you type them again, or there's a hotkey that you press to skip over them.
View user's profileFind all posts by bpat1434Send private messageAIM AddressYahoo MessengerMSN MessengerICQ Number


Joined: 06 Oct 2007
Posts: 11
Reply with quote
That is exactly the point I was trying to make here. Please change this in your software.
View user's profileFind all posts by signal0Send private message


Joined: 05 Aug 2007
Posts: 32
Reply with quote
It also goes back to THIS topic where i originally said that they didn't work properly. To which the quotes were changed to act as expected (typing another one skips right over); however, the brackets were never fixed.

I'm getting 5220 right now, it's not listed as a fix, but hey, they don't actually generate a real list of improvements & fixes (like say the one Mozilla releases with builds).

Nope.... still not working in 5220.... for $300... the least it could do is act in some uniform fashion. I mean, why would the quotes act one way, but the brackets the complete opposite?
View user's profileFind all posts by bpat1434Send private messageAIM AddressYahoo MessengerMSN MessengerICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8328
Reply with quote
Quote:
why would the quotes act one way, but the brackets the complete opposite?

they can't be handled in exactly the same way, just because there are no such things as opening and closing quotation marks while with brackets you always have closing and opening ones.

Finally I'm not sure that after the functionality is chaged, there will be no requests to return it back. So it'd be better if you submit a feature request with qustions to be voted.

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


Joined: 05 Aug 2007
Posts: 32
Reply with quote
Wait.... what do you mean quotes don't have opening and closings? Have you not learned the English language? Forgive me for my bluntness, but come on. There are opening and closing quotes. If there weren't, then to quote something you wouldn't have "Begin quote" whatever needs to be quoted "End quote" in conversations, or you would only see:

"This is something someone said

in written text. If you actually think about it, there are closing quotes, they just don't display differently. Then again, in Microsoft Word, the opening quotes look like a filled in 6, while the closing quotes look like a filled in 9. So you're saying that those aren't opening and closing? That's not to mention that if you were to create a PHP page and leave the string open (i.e. no closing string delimiter, which is a quotation mark (either double or single)) then you'd get a PHP error like:
Quote:
PHP Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /path/to/some/script.php on line #


To further validate that quotation marks are in fact pairs with an opening or closing one, Wikipedia says:
Quote:
The pair consists of an opening quotation mark and a closing quotation mark


I'm sorry, but could you please think before you respond in this forum? I know you're an admin and everything, and you work on the product, but unfounded answers to legitimate issues is not the way to grow your customer base.

EDIT
Quote:
Finally I'm not sure that after the functionality is chaged, there will be no requests to return it back

After it's changed, I'm not sure there will be requests to change it back. Even so, you could make an extra checkbox that enables only if auto-close brackets is enabled which says "Automatically skip over closing brackets" which does what we're asking.
View user's profileFind all posts by bpat1434Send private messageAIM AddressYahoo MessengerMSN MessengerICQ Number


Joined: 14 Jun 2007
Posts: 67
Reply with quote
bpat1434 wrote:
Wait.... what do you mean quotes don't have opening and closings? Have you not learned the English language? Forgive me for my bluntness, but come on. There are opening and closing quotes. If there weren't, then to quote something you wouldn't have "Begin quote" whatever needs to be quoted "End quote" in conversations, or you would only see:

"This is something someone said

I believe what dmitri meant was that the start & end quote are the same character (' or "). () are different, as well as {} being different.
View user's profileFind all posts by CjungeSend private message


Joined: 05 Aug 2007
Posts: 32
Reply with quote
Well, technically they're not the same character, they're just the same typed character. Inside the English language, there are opening and closing quotes (as opening are usually written to reflect a filled "6" and closing to reflect a closed "9") but it's grown to be just two lines instead of real quotes. Same with single quotes. It still doesn't matter. no matter what, with the exception of escaped quotes, you MUST have an even number of quotes in your PHP files. And since we can have settings based on PHP, why can't this be added? When one bracket is entered, +1 for that type, when it's closed -1. If it's 0, then you're fine, if it's +1 and auto-close brackets is enabled, skip the already showing quote.

EDIT Sorry, used "quotes" in my last part instead of "brackets"


Last edited by bpat1434 on Tue Dec 11, 2007 7:50 pm; edited 1 time in total
View user's profileFind all posts by bpat1434Send private messageAIM AddressYahoo MessengerMSN MessengerICQ Number
How do I make auto-close brackets to work?
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 2  

  
  
 Reply to topic