Added BiDi example to demonstrate reordering works
and disabled `wrap simple` since it's not working properly.
This commit is contained in:
parent
c344eec936
commit
cd64388451
3 changed files with 6 additions and 9 deletions
|
|
@ -7,4 +7,5 @@
|
||||||
ویرگول (؛).
|
ویرگول (؛).
|
||||||
تای تأنیث یا ه دو نقطه (ة).
|
تای تأنیث یا ه دو نقطه (ة).
|
||||||
علامت تشدید (ــّـ).
|
علامت تشدید (ــّـ).
|
||||||
|
Testing LEFT‑TO‑RIGHT ISOLATE (U+2066) and POP DIRECTIONAL ISOLATE (U+2069):
|
||||||
|
He said: "بهتره از Rust استفاده کنی".
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ impl<'a> Edit<'a> for SyntaxEditor<'a> {
|
||||||
|
|
||||||
// Update line attributes. This operation only resets if the line changes
|
// Update line attributes. This operation only resets if the line changes
|
||||||
line.set_attrs_list(attrs_list);
|
line.set_attrs_list(attrs_list);
|
||||||
line.set_wrap_simple(true);
|
line.set_wrap_simple(false);
|
||||||
|
|
||||||
//TODO: efficiently do syntax highlighting without having to shape whole buffer
|
//TODO: efficiently do syntax highlighting without having to shape whole buffer
|
||||||
buffer.line_shape(line_i);
|
buffer.line_shape(line_i);
|
||||||
|
|
|
||||||
|
|
@ -420,8 +420,6 @@ impl ShapeSpan {
|
||||||
pub struct ShapeLine {
|
pub struct ShapeLine {
|
||||||
pub rtl: bool,
|
pub rtl: bool,
|
||||||
pub spans: Vec<ShapeSpan>,
|
pub spans: Vec<ShapeSpan>,
|
||||||
pub levels: Vec<Level>,
|
|
||||||
pub runs: Vec<Range<usize>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ShapeLine {
|
impl ShapeLine {
|
||||||
|
|
@ -431,8 +429,6 @@ impl ShapeLine {
|
||||||
attrs_list: &AttrsList
|
attrs_list: &AttrsList
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let mut spans = Vec::new();
|
let mut spans = Vec::new();
|
||||||
let levels = Vec::new();
|
|
||||||
let runs = Vec::new();
|
|
||||||
|
|
||||||
let bidi = unicode_bidi::BidiInfo::new(line, None);
|
let bidi = unicode_bidi::BidiInfo::new(line, None);
|
||||||
let rtl = if bidi.paragraphs.is_empty() {
|
let rtl = if bidi.paragraphs.is_empty() {
|
||||||
|
|
@ -449,7 +445,7 @@ impl ShapeLine {
|
||||||
|
|
||||||
if line_rtl {
|
if line_rtl {
|
||||||
for range in runs.into_iter().rev() {
|
for range in runs.into_iter().rev() {
|
||||||
let span_rtl = levels[range.start].is_rtl(); //paragraph.info.levels[i].is_rtl();
|
let span_rtl = levels[range.start].is_rtl();
|
||||||
spans.push(ShapeSpan::new(
|
spans.push(ShapeSpan::new(
|
||||||
font_system,
|
font_system,
|
||||||
line,
|
line,
|
||||||
|
|
@ -480,7 +476,7 @@ impl ShapeLine {
|
||||||
line_rtl
|
line_rtl
|
||||||
};
|
};
|
||||||
|
|
||||||
Self { rtl, spans, levels, runs }
|
Self { rtl, spans}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn layout(
|
pub fn layout(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue