Repository navigation
feat(editor): warn at bracket navigation boundaries - #322
Merged
Merged
Conversation
fcoury
force-pushed
the
fcoury/bracket-motion-warnings
branch
from
August 23, 2026 00:49
c58f98a to
56b45b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bracket navigation currently fails inconsistently at document boundaries: some motions silently do nothing, some report generic informational text, and diagnostic navigation wraps to the other end of the buffer. This makes it difficult to tell whether Red accepted the command or found no eligible target.
This change gives the default
]and[navigation families consistent, target-specific warning feedback while leaving the cursor unchanged. Diagnostic navigation no longer wraps. Structural operator motions preserve the buffer when their target is missing, and the plugin host gainsPrintWarningso Git hunk navigation can use the same transient warning presentation without creating an acknowledgment obligation.How to Test
]f,]c, or]m. Expect a target-specific warning and no cursor movement.d]fwhere no later function exists. Expect the same warning and no buffer edit.]d. ExpectNo more valid diagnostics to move to; the cursor must not wrap to the first diagnostic.]hor]i. Expect transient warning-styled feedback.cargo test --test movement closing_bracket --no-default-featurescargo test --lib diagnostic_navigation_orders_utf16_positions_without_wrapping --no-default-featurescargo test --lib git_hunk_navigation_targets_changed_lines_and_reports_boundaries --no-default-featurescargo test --lib overlapping_inline_navigation_warns_when_nothing_is_under_the_cursor --no-default-featurescargo test --lib print_warning_is_transient_and_does_not_require_acknowledgment --no-default-featuresThe full Rust validation also passes with
cargo clippy --all-targets --all-features -- -D warnings.