Author Topic: Enhancement request: typing /* should start a block.  (Read 3558 times)

pmwhite

  • Community Member
  • Posts: 98
  • Hero Points: 7
Enhancement request: typing /* should start a block.
« on: November 09, 2012, 06:30:00 pm »
Sometimes I have some existing code that I want to comment out. So I go to the top and type /*. SlickEdit immediately creates the ending */, leaving my cursor in-between the two. Now I have to do more work to get what I want than if SE had left things alone. I have to erase the auto-generated */, then move to the end of my code block and re-add it.

Since /* is typically used for multi-line comments, it would be nice if SE treated it as a block just like curly braces. When I type curly braces, SE lets me use the up/down arrows to include existing lines of code within the new block, automatically reindenting the lines I choose to include.

Phil Barila

  • Senior Community Member
  • Posts: 742
  • Hero Points: 61
Re: Enhancement request: typing /* should start a block.
« Reply #1 on: November 09, 2012, 06:48:35 pm »
Not that I don't think dynamic surround on comments isn't a neat idea, but did know that you can use the "comment" command to comment a selection.  I have Ctrl+Shift+C bound to comment, I use it a lot.  I also have Ctrl+Shift+E bound to comment-erase.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Enhancement request: typing /* should start a block.
« Reply #2 on: November 11, 2012, 06:01:14 am »
I have a hotkey that pops up a menu with my often-used commands that don't quite deserve their own hotkeys.

On that menu I have a macro to surround my current selection with #if0..#endif, another for #ifdef DEBUG..#endif, and another for commenting it out.

I type /* a lot for creating block comments, but I almost never use it as the gesture for commenting out code blocks (and would want to avoid having to always cancel the dynamic surround).
« Last Edit: November 12, 2012, 07:27:43 am by chrisant »

jimlangrunner

  • Senior Community Member
  • Posts: 360
  • Hero Points: 31
  • Jim Lang - always a student.
Re: Enhancement request: typing /* should start a block.
« Reply #3 on: November 11, 2012, 01:44:43 pm »
While I can see how using the arrow key to expand a comment block would be useful, I don't know that I agree. I use Visual Studio emulation, so Ctrl-K,Ctrl-C comments a block, and Ctrl-K,Ctrl-U uncomments the block.  Even if I have nothing selected, it will comment out the line, regardless of what language I'm using.  Incredibly useful.

I do believe that every emulation has a shortcut to comment a block.  Are you aware of it?  Would it be suitable in your situation?


TKasparek

  • Senior Community Member
  • Posts: 231
  • Hero Points: 27
Re: Enhancement request: typing /* should start a block.
« Reply #4 on: November 12, 2012, 04:21:38 pm »
SlickEdit actually makes this more useful than you think. You can place the /* at the top of your block and SE will place the */ right away. Then go to the bottom of your block and place another */ ending block comment and SE will automatically remove the top */ and the whole block will be commented. I use this all the time.
That said, dynamic block comment could be a nice feature.