You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My hardware is compatible and my graphics drivers are up-to-date.
What happened?
I ran into a panic when using a text_editor with content that is long enough that it should line-wrapped, but doesn't contain any spaces to wrap on. To reproduce, enter a line with two words, one short and one long enough to overflow the container. Backspace through the shorter word, and the application will panic.
Minimal reproducible example:
use iced::{widget::text_editor,Sandbox,Settings};constTEXT:&str = r#"short lineerase this "line" Loremipsumdolorsitamet,consecteturadipiscingelit.Vestibulumvenenatisegetelitidconsectetur.Praesentatdiamsem.more short line"#;fnmain() -> iced::Result{Ui::run(Settings::default())}structUi{content: text_editor::Content}#[derive(Debug,Clone)]enumMessage{Edit(text_editor::Action)}implSandboxforUi{typeMessage = Message;fnnew() -> Self{Ui{content: text_editor::Content::with_text(TEXT)}}fntitle(&self) -> String{"".to_string()}fnupdate(&mutself,message:Self::Message){match message {Message::Edit(action) => self.content.perform(action),}}fnview(&self) -> iced::Element<'_,Self::Message>{text_editor(&self.content).on_action(Message::Edit).padding(10).into()}}
What is the expected behavior?
The long word is on its own line without the application panicking.
Version
crates.io release
Operating System
Windows
Do you have any log output?
thread 'main' panicked at G:\packages\cargo\registry\src\index.crates.io-6f17d22bba15001f\iced_graphics-0.12.1\src\text\editor.rs:205:35:
attempt to subtract with overflow
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is this issue related to iced?
What happened?
I ran into a panic when using a
text_editor
with content that is long enough that it should line-wrapped, but doesn't contain any spaces to wrap on. To reproduce, enter a line with two words, one short and one long enough to overflow the container. Backspace through the shorter word, and the application will panic.Minimal reproducible example:
What is the expected behavior?
The long word is on its own line without the application panicking.
Version
crates.io release
Operating System
Windows
Do you have any log output?
The text was updated successfully, but these errors were encountered: