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



Joined: 05 Aug 2007
Posts: 32
Reply with quote
Heh... I guess I replicated this poll in the PhpED discussion forum... oh well..... either way it should get looked at.
View user's profileFind all posts by bpat1434Send private messageAIM AddressYahoo MessengerMSN MessengerICQ Number


Joined: 28 Mar 2007
Posts: 53
Reply with quote
OFF TOPIC: First of all sorry for delay, I was trying to fix some bugs in my scripts Smile

Blizz wrote:
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).


Thank you very much for your explanation. The first paragraph is clear for me (function name compilation with two parentheses and cursor between them) but the second one no Smile I have tried to enable ACB and do the function name compilation as I did it before but there were no errors. I can not get double closing parentheses at the end. Here is all operations which I am doing:

1) I am typing first letters of function name (str_)
2) I am pressing ctrl+space to see the function list
3) I am choosing appropriate one (in case if it is not first one in the list) and I am hitting enter key
4) I am starting adding function parameters (cursor is already moved to correct place)

So up to this point I can not see any problem, may be I have to do something else or ...

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

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Delphi wrote:
1) I am typing first letters of function name (str_)
2) I am pressing ctrl+space to see the function list
3) I am choosing appropriate one (in case if it is not first one in the list) and I am hitting enter key
4) I am starting adding function parameters (cursor is already moved to correct place)

So up to this point I can not see any problem, may be I have to do something else or ...

Hehe okay. Let me try to explain it.

First, imagine not using the code completion but simply typing the function name with ACB enabled:
substr(|) (the bracket in bold is automatically added by the editor and | is where the cursor is).
Now you type the arguments, as normal
substr("test",1, 2|) (again, same thing with bold and cursor)

Now comes the part what this discussion is all about: You type the closing bracket yourself:
substr("test",1, 2)|
In most editors the behavior is to "remember" that it added the closing bracket, and if you type one yourself, you'll overwrite the editor-added one (or it will be skipped as is asked here in the poll, same result), which yields the correct string.
What PHPed does right now, is add a second bracket, like so:
substr("test",1, 2)|)

So the discussion is if this should be changed to match the default behavior in the other editors out there.

The code completion already adds both opening and closing bracket, but imo if the functionality described above is implemented for the ACB option, it should work the same for snippets of code inserted by the code completion.
Hope that makes everything clear.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 28 Mar 2007
Posts: 53
Reply with quote
Blizz wrote:
... The code completion already adds both opening and closing bracket, but imo if the functionality described above is implemented for the ACB option, it should work the same for snippets of code inserted by the code completion.
Hope that makes everything clear.

Thanks, now everything is clear Smile

I think this feature should be implemented not just because it was requested by several PHP developers but because it is better for PhpED itself. As much PhpED will be flexible (will have the features which other debuggers have and even more) as more users will easier move from other debuggers. So my answer "yes".

p.s. but I will suggest to type both open and close parentheses at the same time, the same to the bracket and other paired signs like: (), "", '', {}. In this case you will never forgot to type closing one Wink
View user's profileFind all posts by DelphiSend private messageICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
a) there is nothing wrong with parentheses that are inserted by code completion.
b) over-typing (or keep brace-balancing) is another feature requested there and we need volunteers to check if what we're going to release as build 5021 satisfies them. Please submit your applications in pm to me on this forum. Don't forget to include your status (evaluator vs customer) and provide customer info (if any).
Thanks in advance,
Dmitri.

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


Joined: 06 Oct 2007
Posts: 11
Reply with quote
Thanks for fixing this. I am now a satisfied customer.
View user's profileFind all posts by signal0Send private message
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 2 of 2  

  
  
 Reply to topic