Vscode: Go to next/previous (git) change

Created on 3 Jan 2017  路  13Comments  路  Source: microsoft/vscode

Recently I've been wanting to jump to the next git change/add/delete more and more similar to how F8 will jump to the next problem. I can't find a command for doing this but it would keep my hand off the mouse an awful lot more, especially in large files where scrolling via the scrollbar is not so accurate.

*duplicate feature-request git

Most helpful comment

@joaomoreno to be clear, this is for when the file is not a diff editor.

All 13 comments

workbench.action.compareEditor.nextChange - it doesn't show up in the command palette though

Similar to but not what I'm after. I want to use it in the regular editor to jump to where blue, red and green appear in the scroll bar.

Oh I see - that would be cool

For reference, the Sublime Text "GitGutter" extension has this functionality and it is an incredibly powerful feature.

Depends on #15513 now

@joaomoreno to be clear, this is for when the file is not a diff editor.

Any updates on this? Seems depended issue #15513 is closed

We essentially have this now in Insiders with 'show next change'/'show previous change' to navigate to that spot and show an embedded editor with the diff, but not exactly what the original request was. Try it out though.

Is there a way to only "jump" to the change and not "show" the change (i.e. not have it expand the change details inline every time we navigate between changes)?

Edit: Just tried it out in Insiders. Looking great btw! 馃憤

@roblourens there are some issues with show next change but it's close to what I want:

  • It's popping up a diff dialog which gets in the way for me personally. I want to use this as a way to quickly navigate between chunks of code I've edited, I don't care so much about viewing the actual diff but want to jump to the code I was just working on without using the mouse
  • It's not scrolling to the new line correctly, this may be because the peek view is appearing after the scrolling occurs, pushing it off screen when 2 changes are ~15-20 lines apart

Completely agree with @Tyriar - there is no need to show diff each time I jump to next diff, it's very distracting.
But there are definitely cases when I want to see (toggle) the diff for current line, and it should be done by another key shortcut/action.

Lack of this made me starting using split-view instead. So I don't lose where I'm editing but I can look at other parts of the file for reference. This is the main use-case for this feature which iirc Atom always came with out of the box and it's the main thing that I miss.

Was this page helpful?
0 / 5 - 0 ratings