brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[cmv4] Add Previous/Next Line to Selection may add an extra cursor if you switch direction with the two shortcuts. #12552

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by RaymondLim Thursday Mar 06, 2014 at 01:02 GMT Originally opened as https://github.com/adobe/brackets/issues/7100


  1. Open the index.html from default "Getting Started" project.
  2. Set the cursor in the middle of a long line. e.g. line 21.
  3. Press Alt-Shift-Down arrow to select next line. You will see a new cursor on the next line in the same column.
  4. Press Alt-Shift-Up arrow to select prev line. You will see a new cursor on the previous line after <p> tag since the line is shorter.
  5. Press Alt-Shift-Down arrow to select next line.

Result: You will see two new cursors -- one on line 23 in the same column as the first cursor you set in step 2 and another one on line 21 in the same column as the cursor on line 20. Expected: Should not add another cursor if the line is already in the selection.

core-ai-bot commented 3 years ago

Comment by njx Thursday Mar 06, 2014 at 01:04 GMT


ST and Ace have the same behavior, so I'm inclined to call this "as designed". But I agree it seems weird.

core-ai-bot commented 3 years ago

Comment by RaymondLim Thursday Mar 06, 2014 at 01:05 GMT


Not exactly. ST seems to work correctly for the first time you switch direction, but if you switch one more time, then it gets confused too.

Update: I'm ok to call it as designed if this is going to be hard to get it right.

core-ai-bot commented 3 years ago

Comment by njx Thursday Mar 06, 2014 at 01:20 GMT


Ah, okay. I was looking at a different case, where the cursors started out misaligned.

I wonder if we should just go ahead and fix it generally - basically, the rule would be that we shouldn't add a cursor onto a line that already has a cursor or selection on it. I'm not sure if there's some common use of this that that would break, but since I think the primary use case for it is just quickly creating a vertical cursor selection from the keyboard, it seems like that ought to be okay.

core-ai-bot commented 3 years ago

Comment by njx Thursday Mar 06, 2014 at 23:23 GMT


Decided to leave this open as a low-pri bug for now and wait for user feedback to see if we need to fix it.

core-ai-bot commented 3 years ago

Comment by njx Thursday Jul 10, 2014 at 16:20 GMT


7527 should probably be considered at the same time as this (and vice versa).