From a5c548b12fd50e4edb1b24e3668352c22f64d770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 21 Apr 2023 20:29:56 +0200 Subject: [PATCH] Fix `syntect` module --- src/edit/syntect.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/edit/syntect.rs b/src/edit/syntect.rs index f454285..2c57ca5 100644 --- a/src/edit/syntect.rs +++ b/src/edit/syntect.rs @@ -9,7 +9,7 @@ use syntect::parsing::{ParseState, ScopeStack, SyntaxReference, SyntaxSet}; use crate::{ Action, AttrsList, BorrowedWithFontSystem, Buffer, Color, Cursor, Edit, Editor, FontSystem, - Style, Weight, Wrap, + Shaping, Style, Weight, Wrap, }; pub struct SyntaxSystem { @@ -75,7 +75,9 @@ impl<'a> SyntaxEditor<'a> { let path = path.as_ref(); let text = fs::read_to_string(path)?; - self.editor.buffer_mut().set_text(font_system, &text, attrs); + self.editor + .buffer_mut() + .set_text(font_system, &text, attrs, Shaping::Advanced); //TODO: re-use text self.syntax = match self.syntax_system.syntax_set.find_syntax_for_file(path) {