Skip to content

Commit

Permalink
Add ',' to word chars for line wrapping (#17590)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ZZzzaaKK committed Sep 9, 2024
1 parent da9601c commit f71cb14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/gpui/src/text_system/line_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl LineWrapper {
matches!(c, '\u{0400}'..='\u{04FF}') ||
// 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.
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.
matches!(c, '/' | ':' | '?' | '&' | '=') ||
// `⋯` character is special used in Zed, to keep this at the end of the line.
Expand Down

0 comments on commit f71cb14

Please sign in to comment.