Skip to content

fix(completions): handle UTF-8 cursor sanitization#763

Closed
psteinroe wants to merge 1 commit into
mainfrom
fix/sanitization
Closed

fix(completions): handle UTF-8 cursor sanitization#763
psteinroe wants to merge 1 commit into
mainfrom
fix/sanitization

Conversation

@psteinroe

Copy link
Copy Markdown
Collaborator

Handle completions when the cursor is adjacent to multi-byte UTF-8 characters without panicking. Sanitization now treats completion positions as byte offsets and uses char-boundary-safe helpers before slicing or inspecting surrounding characters.

UTF-8-safe sanitization

The completion sanitizer now avoids direct byte slicing like [1..] and no longer compares byte positions against character indices. A regression test covers completion after è, which previously reproduced the reported crash.

Validated with targeted completion and sanitization tests; full DB-backed completion tests could not run locally because the test Postgres/Docker daemon was unavailable.

Fixes #762

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.

Panic byte index 1 is not a char boundary in sanitization.rs on multi-byte characters (è)

1 participant