Replace magic boolean with new Hinting enum

This commit is contained in:
Héctor Ramón Jiménez 2025-11-23 20:43:33 +01:00 committed by Jeremy Soller
parent 48eda6bd7d
commit d779057d9c
16 changed files with 96 additions and 50 deletions

View file

@ -2,7 +2,7 @@
use std::sync::OnceLock;
use cosmic_text::{Buffer, Cursor, Edit, Metrics, SyntaxEditor, SyntaxSystem, ViEditor};
use cosmic_text::{Buffer, Cursor, Edit, Hinting, Metrics, SyntaxEditor, SyntaxSystem, ViEditor};
static SYNTAX_SYSTEM: OnceLock<SyntaxSystem> = OnceLock::new();
@ -13,7 +13,7 @@ fn editor() -> ViEditor<'static, 'static> {
let line_height = (font_size * 1.4).ceil();
let metrics = Metrics::new(font_size, line_height);
let buffer = Buffer::new_empty(metrics, false);
let buffer = Buffer::new_empty(metrics, Hinting::Disabled);
let editor = SyntaxEditor::new(
buffer,
SYNTAX_SYSTEM.get_or_init(SyntaxSystem::new),