Revert "gpui: Fix shape_text split to support \r\n" (#31031)

Reverts zed-industries/zed#31022

Sorry @mikayla-maki, I found that things are more complicated than I
thought.

The lines returned by shape_text must maintain the same length as all
the original characters, otherwise the subsequent offset needs to always
consider the difference of `\r\n` or `\n` to do the offset.

Before, we only needed to add +1 after each offset after the line, but
now we need to consider +1 or +2, which is much more complicated.
This commit is contained in:
Jason Lee 2025-05-21 00:01:47 +08:00 committed by GitHub
parent 17cf04558b
commit 65e751ca33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -474,7 +474,7 @@ impl WindowTextSystem {
font_runs.clear();
};
let mut split_lines = text.lines();
let mut split_lines = text.split('\n');
let mut processed = false;
if let Some(first_line) = split_lines.next() {