Add ',' to word chars for line wrapping (#17590)

Closes #16407 

Adds ',' to the is_word_char() matches for line wrapping, so that commas
aren't wrapped to the start of a new line.

Release Notes:

- N/A
This commit is contained in:
ZZzzaaKK 2024-09-09 23:52:43 +02:00 committed by GitHub
parent da9601c698
commit f71cb14d7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,7 +153,7 @@ impl LineWrapper {
matches!(c, '\u{0400}'..='\u{04FF}') || matches!(c, '\u{0400}'..='\u{04FF}') ||
// Some other known special characters that should be treated as word characters, // Some other known special characters that should be treated as word characters,
// e.g. `a-b`, `var_name`, `I'm`, '@mention`, `#hashtag`, `100%`, `3.1415`, `2^3`, `a~b`, etc. // e.g. `a-b`, `var_name`, `I'm`, '@mention`, `#hashtag`, `100%`, `3.1415`, `2^3`, `a~b`, etc.
matches!(c, '-' | '_' | '.' | '\'' | '$' | '%' | '@' | '#' | '^' | '~') || matches!(c, '-' | '_' | '.' | '\'' | '$' | '%' | '@' | '#' | '^' | '~' | ',') ||
// Characters that used in URL, e.g. `https://github.com/zed-industries/zed?a=1&b=2` for better wrapping a long URL. // Characters that used in URL, e.g. `https://github.com/zed-industries/zed?a=1&b=2` for better wrapping a long URL.
matches!(c, '/' | ':' | '?' | '&' | '=') || matches!(c, '/' | ':' | '?' | '&' | '=') ||
// `⋯` character is special used in Zed, to keep this at the end of the line. // `⋯` character is special used in Zed, to keep this at the end of the line.