Author Topic: A couple of problems  (Read 8115 times)

jorick

  • Senior Community Member
  • Posts: 390
  • Hero Points: 17
A couple of problems
« on: November 30, 2007, 02:26:58 PM »
1) If I have two comment lines in C with the cursor on the end of the first line as shown by the vertical line:

// This is comment 1|
// This is comment 2

and I want to insert a noncomment line between them, how do I do it?  It used to be Ctrl-Enter.  Then it changed to Shift-Enter after an upgrade.  Now it's completely gone.  Typing either Enter or Ctrl Enter results in:

// This is comment 1
// |
// This is comment 2

and the new comment slashes cannot be removed.  Typing backspace over it causes the entire comment line to be erased and I'm back to square 1.

How do I revert back to using Ctrl-Enter to open a new noncomment line?

=====

2) If I select and copy a columnar text, and then insert this text multiple times, it performs the insert wrong.  For example, I have the following lines of text in a file:

Var1 = 0;
Var2 = 3;
Var3 = 7;
Var4 = 2;

And I have the following columnar text in the clipboard:

int
int

I put the cursor in front of "Var1" and hit insert twice.  I would expect to see

int Var1 = 0;
int Var2 = 3;
int Var3 = 7;
int Var4 = 2;

but instead I see

int int Var1 = 0;
int int Var2 = 3;
Var3 = 7;
Var4 = 2;

because the cursor didn't drop to the third line after the first insert was done.  This didn't used to be this way.  When I first started using SlickEdit, it worked fine but after an upgrade it broke.

How do I revert to the original operation where the cursor drops to the next line after a columnar insert?

TIA,
Ricky

jorick

  • Senior Community Member
  • Posts: 390
  • Hero Points: 17
Re: A couple of problems
« Reply #1 on: November 30, 2007, 03:51:26 PM »
I found the answer to #2 at http://community.slickedit.com/index.php?topic=2385.0.  I didn't see it before because I searched on "column", not "block".

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: A couple of problems
« Reply #2 on: November 30, 2007, 03:57:40 PM »
About the blank line between line comments, unfortunately there is no single keystroke for this when comment wrapping for line comments is on.  We have logged a report and will reexamine the default behavior for the ctrl-Enter key stroke in line comments.  In any case, a solution to insert the blank line easily will be forthcoming in a future release or hotfix.
 
In the meantime, you can get rid of the extra '//' in the middle line by hitting Home and then Delete twice.  Or use shift+backspace to highlight the '//' and then hit backspace or delete.  Or if you don't really need comment wrapping for line comments, you can turn it off by going to file extension setup (Tools -> Options -> File Extension Setup), then select the Comment Wrap tab and uncheck Enable line comment wrap.
 
Hope that helps.

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: A couple of problems
« Reply #3 on: December 01, 2007, 03:42:54 AM »
Doesn't shift-enter start a new line without a comment? It does for me, and I don't think I've modified anything.

David_O

  • Senior Community Member
  • Posts: 152
  • Hero Points: 8
Re: A couple of problems
« Reply #4 on: December 03, 2007, 03:25:50 PM »
Yes.  I should have mentioned that option as well.  Shift-Enter will bypass comment wrapping.  However, that will only work at the end of a line.  You'll split your line if you do Shift-Enter in the middle of text.

Ctrl-Enter will not split the line.  You can think of it as being equal to hitting End and then Enter.

Since jorick mentioned Ctrl-Enter, I was focused on a single key way that also gets the no-split aspect of Ctrl-Enter without the wrapping.  But looking again at his posted example, he has his cursor at the end of line.  Shift-Enter should do the trick in this case.

Thanks for the reminder.

jorick

  • Senior Community Member
  • Posts: 390
  • Hero Points: 17
Re: A couple of problems
« Reply #5 on: December 03, 2007, 06:32:07 PM »
On my computer, Shift-Enter is mapped to plusminus which expands or collapses selective display blocks.  This is apparently the default functionality because I haven't changed it.  When used at the end of a comment line, it does absolutely nothing.  No carriage return, no characters inserted.  What do I need to map it to to get it to bypass comment wrapping?

I just found it.  it's keyin-enter.  Problem 1 solved.

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: A couple of problems
« Reply #6 on: December 03, 2007, 06:35:26 PM »
Ctrl-Enter will not split the line.  You can think of it as being equal to hitting End and then Enter.
Ah! Don't think I've ever used that one, but I'll make a point of doing it at least once a day now :)

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: A couple of problems
« Reply #7 on: December 03, 2007, 07:05:53 PM »
BTW: I think the related commands are (no)split-insert-line. HS2

Dennis

  • Senior Community Member
  • Posts: 3954
  • Hero Points: 515
Re: A couple of problems
« Reply #8 on: December 11, 2007, 05:43:26 PM »
Another one of my favorite commands is "nosplit_insert_line_before", which is bound to "Ctrl+Shift+Enter" by default in most emulations.

It is easy to remember, if you think of Shift as a modifier for doing something in the reverse direction that the unmodified key sequence does.  That is:  Ctrl+Enter opens a new line after the current line, therefore Ctrl+Shift+Enter should open a new line before the current line.

dunkers

  • Senior Community Member
  • Posts: 774
  • Hero Points: 36
Re: A couple of problems
« Reply #9 on: December 11, 2007, 06:53:24 PM »
Quote
It is easy to remember...

Oh yes, it's just the other 724 commands that are hard  ;D

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: A couple of problems
« Reply #10 on: December 11, 2007, 07:08:41 PM »
@dunkers Good one ;D ;D ;D