Author Topic: can auto insert ")" when i input "("?  (Read 3644 times)

turingcat

  • Community Member
  • Posts: 7
  • Hero Points: 0
can auto insert ")" when i input "("?
« on: December 25, 2008, 07:01:38 am »
i wonder to know whether slickedit can auto insert ")" when i input "(" ,just like eclipse.also when i input a ",it can auto insert another " too?

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: can auto insert ")" when i input "("?
« Reply #1 on: December 29, 2008, 03:07:19 pm »
No, we don't have a feature for that. It's a neat idea and we'll look into doing that in a future release.

dpsel

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: can auto insert ")" when i input "("?
« Reply #2 on: January 08, 2009, 06:22:11 pm »
This is one of the features I really like about eclipse, just something simple yet so helpful.

The other thing about this that the original poster did not mention is that as you are typing, say you type:

"some_function_call(" <- you typed | auto inserted -> )

it would auto insert the closing ")", but as you keep typing if you type your own ")" it will just overwrite the one that was auto inserted.

So:
some_function_call(somevariable) <- you typed | -> auto inserted)

Would become:
some_function_call(somevariable)

jimlangrunner

  • Senior Community Member
  • Posts: 354
  • Hero Points: 30
  • Jim Lang - always a student.
Re: can auto insert ")" when i input "("?
« Reply #3 on: January 08, 2009, 08:57:19 pm »
The real advantage to such a feature shows in color coding.  Now, when I'm typing a string, all code following my typing position turns cyan until I close the string.  Comments in my SQL files turn green.  I can live with it.

But SQL prompt inserts the closing character, which just keeps the rest of my editor colored nicely.

Wanderer

  • Senior Community Member
  • Posts: 558
  • Hero Points: 23
Re: can auto insert ")" when i input "("?
« Reply #4 on: January 09, 2009, 12:12:03 am »
i wonder to know whether slickedit can auto insert ")" when i input "(" ,just like eclipse.also when i input a ",it can auto insert another " too?

I'm guessing you don't use the vim key mapping...  I do, and I'm not so much a fan of auto-inserted ')' or '"'.
If I type (" and ") is autoinserted, I have to Esc, shift-a to get to the end of the line to add the ';'.  I prefer to keep typing and close them myself.  As someone else points out, with color coding you know when you are typing in a string, and that's reminder enough for me to add the closing token.

jimlangrunner

  • Senior Community Member
  • Posts: 354
  • Hero Points: 30
  • Jim Lang - always a student.
Re: can auto insert ")" when i input "("?
« Reply #5 on: January 09, 2009, 02:28:00 pm »
i wonder to know whether slickedit can auto insert ")" when i input "(" ,just like eclipse.also when i input a ",it can auto insert another " too?

I'm guessing you don't use the vim key mapping...  I do, and I'm not so much a fan of auto-inserted ')' or '"'.
If I type (" and ") is autoinserted, I have to Esc, shift-a to get to the end of the line to add the ';'.  I prefer to keep typing and close them myself.  As someone else points out, with color coding you know when you are typing in a string, and that's reminder enough for me to add the closing token.

Not to belabor the too much, but typing the closing quote or closing paren should "skip" the closing character and place the cursor past. 

Consider:
Code: [Select]
"|"(type the opening quote, the cursor is between two quotes)
Code: [Select]
"The quick Brown Fox."|when I type the closing quote, the cursor magically types over the closing quote.

So let me clarify a bit.  The closing character, if it appears, should be over-written by the closing character, just as it you had typed it yourself.  On the other hand, if I'm in the middle of something and get called away, having my block closed is convenient as well.  That does happen.

Frankly, if it didn't work that way, I simply wouldn't use it.

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: can auto insert ")" when i input "("?
« Reply #6 on: January 19, 2009, 04:16:02 pm »
You're absolutely right, Jim. And that's why we don't have this yet. We are looking at this for a future release, though.

jimlangrunner

  • Senior Community Member
  • Posts: 354
  • Hero Points: 30
  • Jim Lang - always a student.
Re: can auto insert ")" when i input "("?
« Reply #7 on: January 21, 2009, 03:54:26 pm »
You're absolutely right, Jim. And that's why we don't have this yet. We are looking at this for a future release, though.
Thanks Scott.  That's something to look forward to.   :D  (waiting patiently)  8)