Skip to content

Commit b18c7f4

Browse files
committed
Explicitly set cosmic_text wrapping to Glyph, as there is no fallback from Word -> Glyph in cases where a long uninterrupted string of characters is inserted and overflows the buffer bounds.
1 parent 385a449 commit b18c7f4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

graphics/src/text/editor.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ impl editor::Editor for Editor {
7575
cosmic_text::Shaping::Advanced,
7676
);
7777

78+
// For now, there is no graceful fallback from word -> glyph wrapping, so if you type
79+
// a bunch of letters in a row they will overflow the text bounds. For now, we explicitly
80+
// set glyph wrapping to avoid overflow issues.
81+
//see: https://github.com/pop-os/cosmic-text/issues/219
82+
buffer.set_wrap(font_system.raw(), cosmic_text::Wrap::Glyph);
83+
7884
Editor(Some(Arc::new(Internal {
7985
editor: cosmic_text::Editor::new(buffer),
8086
version: font_system.version(),

0 commit comments

Comments
 (0)