Search code examples
intellij-idea

Navigate to the changed lines of code in a file in IntelliJ IDEA


I have a huge class in which I changed couple of lines in different places. Is there a way (shortcut) to navigate through changed lines of code in the file and not to scroll all the way up/down?


Solution

  • From the official IntelliJ IDEA documentation:

    Navigate between changes

    If you edit a file that is under version control, IntelliJ IDEA provides several ways to move back and forth with the updates. In particular, you can use the navigation commands, keyboard shortcuts, and the change markers.

    • Press ⌃ Ctrl⌥ Opt⇧ Shift / ⌃ Ctrl⌥ Opt⇧ Shift.

    • In the main menu, go to Navigate | Next / Previous Change.

    • Click a change marker, and then click the ↑ (the Previous Change button) or ↓ (the Next Change button).

    To navigate to the place of your last edit, press ⌘ Сmd⇧ Shift⌫ Backspace or select Navigate | Last Edit Location from the main menu.