NuSphere Forums Forum Index
NuSphere Forums
Reply to topic

Would you benefit from "Closing Bracket Overtype" as described below?
Yes, please change it to work like other editors.
100%
 100%  [ 12 ]
No, leave it the way it is.
0%
 0%  [ 0 ]
Total Votes : 12

Closing Bracket Overtype


Joined: 06 Oct 2007
Posts: 11
Reply with quote
In Zend Studio, closing brackets are overtyped in the same way that quotes work in PhpED.

Example:
In Zend Studio, if I type
Code:
require('include.php');
I get
Code:
require('include.php');


For contrast, in PhpED, if I type
Code:
require('include.php');
I get
Code:
require('include.php'));
View user's profileFind all posts by signal0Send private message


Joined: 28 Mar 2007
Posts: 53
Reply with quote
To be honest I can not understand what about your are speaking Sad Could you please make it more clear what you have done to get
Code:
require('include.php'));

instead of
Code:
require('include.php');

I have never come across with such problem Surprised "))"

Added
I get it now, you have checked "Auto-close quotes" and "Auto-close brackets" right? To be honest I prefer to type both of them by myself Smile it is comes from early beginning of DOS editors. My teacher suggests to type both of them at the same time and move cursor back Wink So why there is not possible answer "it does not matter"Smile
View user's profileFind all posts by DelphiSend private messageICQ Number


Joined: 06 Oct 2007
Posts: 11
Reply with quote
The problem is that even with auto-close brackets OFF it still inserts one when using code completion. That's fine, I just want it to overtype the second one.
View user's profileFind all posts by signal0Send private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
signal0 wrote:
The problem is that even with auto-close brackets OFF it still inserts one when using code completion.

That's the second time I see you making that claim. Can you give me a example of something that produces 2 brackets with you and what exactly you did to get that?
I haven't been able to reproduce this with the option disabled.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Blizz wrote:
That's the second time I see you making that claim. Can you give me a example of something that produces 2 brackets with you and what exactly you did to get that? I haven't been able to reproduce this with the option disabled.

+1
View user's profileFind all posts by DelphiSend private messageICQ Number


Joined: 06 Oct 2007
Posts: 11
Reply with quote
Here's a link to a video (6mb, sorry) that shows exactly what the problem is. Keep in mind this occurs with both native php functions and functions from included files.

http://www.adaptivecreativity.com/demo.avi
View user's profileFind all posts by signal0Send private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Aha, now I get it. What you are showing there is code completion. It has absolutely nothing to do with the Auto Close Bracket function.
So the behavior you get is expected.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 06 Oct 2007
Posts: 11
Reply with quote
Actually, it's not expected. Every other IDE I've ever used (not just for php) has overtyped that second bracket. I don't see what the problem is with adding this to PhpED.

Humorously, this issue is the only thing stopping us from purchasing this software for the other 6 devs in the office. They don't want it as it is.


Last edited by signal0 on Wed Dec 12, 2007 10:37 am; edited 1 time in total
View user's profileFind all posts by signal0Send private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
It is different functionality you are talking about. But I fully agree with you, now that we're finally talking about the same thing Wink

Suppose you have auto-close brackets (AOB) enabled and you use the code completion to add a function call (with brackets) then you should OVERTYPE the closing bracket (on the condition that this is the default behavior when you have the AOB option enabled). At least that is how I see it.

So with the AOB option enabled the closing bracket of an auto inserted function call should be looked at as if it were auto inserted.
At this point the editor sees it as a completely different operation.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Quote:
looked at as if it were auto inserted

I think that the other editors supporting AOB do not recognize if closing bracket is auto-inserted or not. Try them with a file full of )))))) and you'll see.

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


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Blizz wrote:
Aha, now I get it. What you are showing there is code completion. It has absolutely nothing to do with the Auto Close Bracket function.
So the behavior you get is expected.

I have downloaded the movie but can not understand how signal0 managed to type both '' marks (I guess some shortcut)? I have checked PhpED for "auto completion" but can not find anything new for me. I know only two type of shortcuts ctrl+space and ctrl+shift+space. The first one is for the function names' completion and the second one is to show function arguments' list. Is there any other?
View user's profileFind all posts by DelphiSend private messageICQ Number
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
It is code completion we are talking about (Look under Code Insight > Settings).
If you have the Auto Close Bracket (ACB) option enabled the editor will insert a closing bracket when you type an opening bracket.
When you use the code completion (or auto completion or whatever you wish to call it) the editor inserts the function name completely with both open and closing parentheses and puts the cursor between them.

The discussion is that when a bracket is added by the ACB-functionality (how the hell did I come up with AOB?) of the editor, you should overtype it when you manually type a matching closing bracket. However, a bracket pair inserted by code completion usually does not work that way (I personally think it should).

Talking about the code completion and a bit off topic: I still wish there would be the possibility of adding a space in the inserted text (function_() instead of function()). Perhaps define a template for the code completion? Like "<function> ( | );" or something.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Closing Bracket Overtype
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