microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.36k stars 29.31k forks source link

Command+I selection on Mac mistakenly place the cursor at the beginning of the next line #22431

Closed cateyes99 closed 7 years ago

cateyes99 commented 7 years ago

Steps to Reproduce:

  1. Enter some lines of text.
  2. Place cursor in the middle of a line which has lines beneath it.
  3. Shortcut Command+I to select the line.
  4. Observe that the line has been selected but the cursor has been moved to the beginning of the next line. Before the version of 1.10.0, the behaviour is different that the cursor will be left at the end of the selected line. The new behaviour is annoying!
kaiwood commented 7 years ago

Feature is less about cursor position, more about catching the newline symbol at the end of the line. Its called expandLineSelection because its purpose is selecting whole blocks by pressing the key multiple times. If you do not select the newline symbol, you'll end up with a selected block of text where the last newline is simply missing and pasting that block acts strangely.

As designed, introduced in https://github.com/Microsoft/vscode/pull/15564

cateyes99 commented 7 years ago

ic. well with the new behaviour, after u selects the whole block, then type some text, the next line will become being appended to what u just entered. It's a bit annoying to me. but I guess depending on ur habits of how to use it. If more people think the new one is more desired then i think this ticket can be closed.