fun shiftDown()

in src/main/kotlin/com/jetbrains/interactiveRebase/listeners/BranchNavigationListener.kt [159:184]


    fun shiftDown() {
        project.takeAction {
            val branch = modelService.getSelectedBranch()
            if (branch.selectedCommits.size == 0) {
                val commit = branch.currentCommits[0]
                modelService.addToSelectedCommits(commit, branch)
                return@takeAction
            }
            val commit = modelService.getLastSelectedCommit()

            val index = branch.currentCommits.indexOf(commit)
            if (index == branch.currentCommits.size - 1) {
                return@takeAction
            }

            var nextCommit = branch.currentCommits[index + 1]
            if (nextCommit.isCollapsed) {
                nextCommit = branch.currentCommits[index + 2]
            }
            if (!nextCommit.isSelected) {
                modelService.addToSelectedCommits(nextCommit, branch)
            } else {
                modelService.removeFromSelectedCommits(commit, branch)
            }
        }
    }