Merge pull request #124 from tigregalis/iter-bidi-para
Replace use of `str::Lines` with `unicode-bidi`-based iterator
This commit is contained in:
commit
b5f45f81f6
4 changed files with 48 additions and 6 deletions
|
|
@ -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
|
||||
|
|
@ -594,7 +594,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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue