summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
Diffstat (limited to 'widget')
-rw-r--r--widget/src/lib.rs2
-rw-r--r--widget/src/text_editor.rs17
2 files changed, 18 insertions, 1 deletions
diff --git a/widget/src/lib.rs b/widget/src/lib.rs
index e3335a98..2f959370 100644
--- a/widget/src/lib.rs
+++ b/widget/src/lib.rs
@@ -4,7 +4,7 @@
)]
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(
- //missing_debug_implementations,
+ missing_debug_implementations,
missing_docs,
unused_results,
rustdoc::broken_intra_doc_links
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index da1905dc..ac24920f 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -14,6 +14,7 @@ use crate::core::{
};
use std::cell::RefCell;
+use std::fmt;
use std::ops::DerefMut;
use std::sync::Arc;
@@ -21,6 +22,7 @@ pub use crate::style::text_editor::{Appearance, StyleSheet};
pub use text::editor::{Action, Edit, Motion};
/// A multi-line text input.
+#[allow(missing_debug_implementations)]
pub struct TextEditor<'a, Highlighter, Message, Renderer = crate::Renderer>
where
Highlighter: text::Highlighter,
@@ -257,6 +259,21 @@ where
}
}
+impl<Renderer> fmt::Debug for Content<Renderer>
+where
+ Renderer: text::Renderer,
+ Renderer::Editor: fmt::Debug,
+{
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ let internal = self.0.borrow();
+
+ f.debug_struct("Content")
+ .field("editor", &internal.editor)
+ .field("is_dirty", &internal.is_dirty)
+ .finish()
+ }
+}
+
struct State<Highlighter: text::Highlighter> {
is_focused: bool,
last_click: Option<mouse::Click>,