fix(tui): preserve ASCII punctuation word boundaries with Intl.Segmenter (#5067)

This commit is contained in:
xu0o0
2026-05-27 18:12:10 +08:00
committed by GitHub
parent 493efd422d
commit b62776e4a2
4 changed files with 66 additions and 6 deletions

View File

@@ -757,7 +757,7 @@ function wrapSingleLine(line: string, width: number): string[] {
return wrapped.length > 0 ? wrapped.map((line) => line.trimEnd()) : [""];
}
const PUNCTUATION_REGEX = /[(){}[\]<>.,;:'"!?+\-=*/\\|&%^$#@~`]/;
export const PUNCTUATION_REGEX = /[(){}[\]<>.,;:'"!?+\-=*/\\|&%^$#@~`]/;
/**
* Check if a character is whitespace.