Skip to content

feat: add cycle_next_hunk option to disable hunk navigation wrap-around#227

Merged
esmuellert merged 2 commits intomainfrom
dev/main
Feb 5, 2026
Merged

feat: add cycle_next_hunk option to disable hunk navigation wrap-around#227
esmuellert merged 2 commits intomainfrom
dev/main

Conversation

@esmuellert
Copy link
Owner

Summary

Adds diff.cycle_next_hunk config option to control whether ]c/[c navigation wraps around when reaching the first/last hunk.

Changes

  • Added diff.cycle_next_hunk option (default: true)
  • When set to false, navigation stops at boundaries and shows a warning message
  • Updated README with new option

Usage

require('codediff').setup({
  diff = {
    cycle_next_hunk = false, -- Stop at first/last hunk instead of cycling
  },
})

Benefits

Closes #219

Adds diff.cycle_next_hunk config option (default: true) that controls
whether ]c/[c navigation wraps around when reaching the first/last hunk.

When set to false, navigation stops at boundaries and shows a warning
message indicating the user is at the first or last hunk.

Closes #219
@esmuellert esmuellert enabled auto-merge February 5, 2026 05:04
@esmuellert esmuellert merged commit e4b8d06 into main Feb 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[question] How to Disable File Cycling When Reviewing Changes

1 participant