Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Add Unicode range for Bengali (#51659)

Cameron Mcloughlin93f3286faeaf
diff --git a/crates/gpui/src/text_system/line_wrapper.rs b/crates/gpui/src/text_system/line_wrapper.rs
index 07df35472b0..9a7d10133bb 100644
--- a/crates/gpui/src/text_system/line_wrapper.rs
+++ b/crates/gpui/src/text_system/line_wrapper.rs
@@ -236,6 +236,9 @@ impl LineWrapper {
matches!(c, '\u{1E00}'..='\u{1EFF}') || // Latin Extended Additional
matches!(c, '\u{0300}'..='\u{036F}') || // Combining Diacritical Marks
+ // Bengali (https://en.wikipedia.org/wiki/Bengali_(Unicode_block))
+ matches!(c, '\u{0980}'..='\u{09FF}') ||
+
// 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`, `a=1`, `Self::new`, etc.
@@ -856,6 +859,10 @@ mod tests {
assert_word("АБВГДЕЖЗИЙКЛМНОП");
// Vietnamese (https://github.com/zed-industries/zed/issues/23245)
assert_word("ThậmchíđếnkhithuachạychúngcònnhẫntâmgiếtnốtsốđôngtùchínhtrịởYênBáivàCaoBằng");
+ // Bengali
+ assert_word("গিয়েছিলেন");
+ assert_word("ছেলে");
+ assert_word("হচ্ছিল");
// non-word characters
assert_not_word("你好");