replace use of str::lines with BidiParagraphs

This commit is contained in:
tigregalis 2023-05-08 18:12:36 +08:00
parent e298259dd5
commit 6e336ad1cd
2 changed files with 6 additions and 5 deletions

View file

@ -9,8 +9,8 @@ use core::{cmp, fmt};
use unicode_segmentation::UnicodeSegmentation;
use crate::{
Attrs, AttrsList, BorrowedWithFontSystem, BufferLine, Color, FontSystem, LayoutGlyph,
LayoutLine, ShapeLine, Shaping, Wrap,
Attrs, AttrsList, BidiParagraphs, BorrowedWithFontSystem, BufferLine, Color, FontSystem,
LayoutGlyph, LayoutLine, ShapeLine, Shaping, Wrap,
};
/// Current cursor location
@ -580,7 +580,7 @@ impl Buffer {
shaping: Shaping,
) {
self.lines.clear();
for line in text.lines() {
for line in BidiParagraphs::new(text) {
self.lines.push(BufferLine::new(
line.to_string(),
AttrsList::new(attrs),