microsoft / vscode

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

Keyboard shortcuts for showing/hiding unchanged regions #186425

Open roblourens opened 1 year ago

roblourens commented 1 year ago

Testing #186213

image

I've noticed that if I use cmd+down/up, it will unfold that region and move the cursor in. I can't find any other keyboard shortcuts for it and the commands don't show up in the command palette. Just one option that comes to mind

weartist commented 1 year ago

Can I submit a PR for this issue?

hediet commented 1 year ago

@weartist I think this requires more thoughts on how these commands should work.

@jrieken I know you do something similar with the inline chat, maybe I should copy your solution

dimateos commented 1 year ago

I think first there should be simple commands that replicate the UI button actions:

Then, maybe this combined with context keys can achieve the keybind CTRL+up/down suggested. For example "isAboveCollapsedRegion" when the next line is collapsed.

On top of that there could be a command to expand/collapse line by line instead of the whole region. So you could hold/tap CTRL+up/down to expand a few lines like you can do now with dragging.

Expand/fold all command requested at https://github.com/microsoft/vscode/issues/188416 already with a PR