Skip to content

Fix surround operations on selections ending at EOF - #16175

Open
Boulea7 wants to merge 1 commit into
helix-editor:masterfrom
Boulea7:fix/14923-eof-surround
Open

Fix surround operations on selections ending at EOF#16175
Boulea7 wants to merge 1 commit into
helix-editor:masterfrom
Boulea7:fix/14923-eof-surround

Conversation

@Boulea7

@Boulea7 Boulea7 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • accept surround selections whose half-open range ends exactly at EOF
  • continue rejecting ranges that extend beyond the text
  • cover EOF deletion through the existing core surround and transaction path

Closes #14923

Testing

  • RED: cargo test -p helix-core surround::test::test_get_surround_pos_full_range_ending_at_eof_can_be_deleted -- --exact --nocapture failed with RangeExceedsText before the fix
  • GREEN: cargo test -p helix-core surround::test (11 passed)
  • cargo test -p helix-core (171 unit tests, 4 integration tests, and 5 doc tests passed; 3 doc tests ignored)
  • HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1 cargo test --workspace
  • cargo fmt --all --check
  • HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1 cargo check
  • HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1 cargo clippy --workspace --all-targets -- -D warnings
  • git diff --check

The Rust and Ruby tree-sitter grammars were fetched and built locally because the full helix-core syntax tests require them. HELIX_DISABLE_AUTO_GRAMMAR_BUILD=1 only disabled the expensive automatic fetch/build of all runtime grammars for the workspace commands; it did not skip Rust crates or tests. A default cargo check attempt was stopped after the generated gitcommit parser had been compiling at -O3 for over eight minutes; the command then passed with the automatic grammar build disabled.

@Boulea7
Boulea7 marked this pull request as ready for review August 12, 2026 08:42
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.

Cursor range exceeds text length

1 participant