Author Topic: Move cursor down after using Edit.Selection[Un]Comment  (Read 3988 times)

Offline Anonymous

  • Anonymous
  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Move cursor down after using Edit.Selection[Un]Comment
« on: March 23, 2011, 11:39:57 am »
It would be nice if HippoEdit moved cursor down after [un]commenting current line (not the selection).

And, by the way, there is no need in commenting already commented lines. IMHO.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #1 on: March 23, 2011, 12:19:48 pm »
Quote
It would be nice if HippoEdit moved cursor down after [un]commenting current line (not the selection).
Well, I have nothing against of this request, can be done. But before I would like to know the scenario and what are the benefits from this change?

Quote
And, by the way, there is no need in commenting already commented lines. IMHO.
Here I would disagree. Imagine scenario, when you have some block of code with some lines commented (code or real comments) and do commenting. With your logic, if only not commented lines will be commented, with further uncomment of the block, also original comments will be uncommented. And I do not think that this what user want. Or you need to do uncommenting already partially.
And current behavior is also standard in other editors as Visual Studio fex.

Offline Anonymous

  • Anonymous
  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #2 on: March 23, 2011, 01:20:38 pm »
Well, I have nothing against of this request, can be done. But before I would like to know the scenario and what are the benefits from this change?

The only benefit is speed especially when you are using keyboard, as I do. Just tap Ctrl+"." several times to [un]comment out few lines. This is the way the Multi-Edit did.

Here I would disagree. Imagine scenario, when you have some block of code with some lines commented (code or real comments) and do commenting. With your logic, if only not commented lines will be commented, with further uncomment of the block, also original comments will be uncommented. And I do not think that this what user want. Or you need to do uncommenting already partially.
And current behavior is also standard in other editors as Visual Studio fex.

You are right. Then we should talk about "ToggleComment" feature.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #3 on: March 23, 2011, 04:07:09 pm »
Quote
The only benefit is speed especially when you are using keyboard, as I do. Just tap Ctrl+"." several times to [un]comment out few lines. This is the way the Multi-Edit did.
Ok, this is accepted. One more argument was that such way is already implemented in other editor. What is the position of the cursor after move? Direct under previous position or beginning/end of the line?

About commenting of the already commented lines (I have thought about this a little bit more), such check can be done only such commenting is applied for sinlge line like in example above, but should be skipped for multi line selection and explicit selection.

Offline Anonymous

  • Anonymous
  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #4 on: March 23, 2011, 11:27:35 pm »
What is the position of the cursor after move? Direct under previous position or beginning/end of the line?

Right below, if possible. I mean if next line is long enough to keep the position.

About commenting of the already commented lines (I have thought about this a little bit more), such check can be done only such commenting is applied for sinlge line like in example above, but should be skipped for multi line selection and explicit selection.

I understand the case. And it is clear that "ToggleComment" can not be applied to a milti-line comments, too. So it turns into a "ToggleLineComment" feature. To be honest, I'm not in a great need of it for I prefer to indicate my intentions explicitly by using straight functions - "comment" or "uncomment". But maybe some day it would be useful for someone else. Just keep the idea in mind.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #5 on: March 24, 2011, 12:20:23 am »
Ok, will be added in next beta.
Toggle I will leave for some time - work with comments is not trivial, especially if supporting all kinds of languages.

Offline Anonymous

  • Anonymous
  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #6 on: March 29, 2011, 08:55:17 am »
On 1.49.804 Edit.SelectionComment works as it was intended to, but Edit.SelectionUncomment stayed untouched.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #7 on: March 29, 2011, 10:28:12 am »
Yes, I just forgot about this :/ Will be added next beta.

Offline Anonymous

  • Anonymous
  • Jr. Member
  • **
  • Posts: 77
  • Karma: +0/-0
    • View Profile
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #8 on: April 11, 2011, 12:29:54 pm »
Done in 1.49.805. Now we have a sweet pair to our pleasure.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Move cursor down after using Edit.Selection[Un]Comment
« Reply #9 on: April 11, 2011, 12:56:02 pm »
:)