2

I tried to shift the lines using ALT+CLICK but it erased the t from the word Height and also break the indentation inside the loop.

What the correct way to shift multiple lines at once including lines inside collapsed brackets?

BSMP
  • 4,596
  • 8
  • 33
  • 44
  • you could move a selection up and down, mark the codeblock to move - hold ```alt``` and use cursor up or down, if this is enough for your scenario – Kraego Apr 23 '21 at 21:14
  • I dont understand what you mean? –  Apr 23 '21 at 21:19
  • If you just want shift everything to the left, use shift tab. – Kraego Apr 23 '21 at 22:21
  • @kraego shift tab did it, is possible to change this behavior to default? I mean, instead `select all lines > shift+tab`, just `select all lines > backpspace` –  Apr 23 '21 at 22:36
  • Does this answer your question? [How to shift a block of code left/right by one space in VSCode?](https://stackoverflow.com/questions/47903209/how-to-shift-a-block-of-code-left-right-by-one-space-in-vscode) – Kraego Apr 23 '21 at 23:06

1 Answers1

4
  1. Select Code Block and press shift + tab
  2. Select Code Block Ctrl + [ (for left shift one indent), Ctrl + ] (for right shift one indent)
  3. Change to column selection, select all rows (cursor a position of code to shift) + backspace
Kraego
  • 2,978
  • 2
  • 22
  • 34
  • It does not work when on lines collapsed, you know why? –  Apr 23 '21 at 23:21
  • Yes you're right, the collapsed lines are not shifted, when using method 3. Hard to tell if it's a feature or a bug. – Kraego Apr 23 '21 at 23:31