There used to be a button in VS Code’s Diff view which controlled whether the entire file, or just the parts that changed, would be shown. It was the accordion-looking icon in the upper right hand corner of this screenshot, two to the left of the ellipses:
I’m no longer seeing this icon (I’m running VS Code version 1.86.1).
What was this feature called? Does it still exist? Is it possible for me to customize the UI of my editor to put the icon back where it was?
Edit: I figured out that it’s called "Show/Collapsed Unchanged Regions". I still see it in the toolbar for the inline diff view, but not for the split view. I’m still curious if it’s possible to add it back to the toolbar for the split view?
2
Answers
Check your
diffEditor.hideUnchangedRegions.enabled
setting. You want it unchecked in the settings (false
).There is also a keyboard shortcut
diffEditor.toggleCollapseUnchangedRegions
you can keybind to toggle it on and off dynamically:I believe the button you are also looking for is in the top right:
The toolbar has a size limit (see issue ticket #115198), and for some reason that action’s button seems to be the first to go (at the time of this writing) when things have to overflow- even though it’s not the last on the list- for some reason the button for splitting the editor (which is the last on the list has extra survival powers / plot armour).
If you want that action button to show up in the menu, you’ll need to kick something else out- at least at the time of this writing; maybe the behaviour of VS Code with respect to this will change in the future. Right click one of the action buttons, and you’ll get a top-of-list option to hide it (Ex "Hide ‘Add Debug Configuration’"), or you can just click its entry in the rest of the context menu item list to toggle whether it is shown or not (checkmark means it will be shown if it doesn’t overflow).
Also, note that the action is still accessible even if its button has overflowed. You can click the three dot menu which shows the full menu in textual form, where that action is still available, or you can use the commands
Diff Editor: Show All Unchanged Regions
andDiff Editor: Collapse All Unchanged Regions
in the command palette, or bind a keyboard shortcut to thediffEditor.toggleCollapseUnchangedRegions
command ID.