summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoscha <joscha@plugh.de>2022-09-25 19:47:04 +0200
committerJoscha <joscha@plugh.de>2022-09-25 20:02:38 +0200
commit147c3eaf92afe0c1c6c89d44d3b0f0f28e5c9c72 (patch)
tree0f4aa6cdc6411a5e96af89943cd67aa575283d62
parentd5c0c948831df632ba093dd846ad6918169591cc (diff)
Clean up use of Size
-rw-r--r--src/main.rs1
-rw-r--r--src/ui/widgets/editor.rs6
2 files changed, 1 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 9b99d3e..2b6c09a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,7 +15,6 @@
#![warn(clippy::use_self)]
// TODO Enable warn(unreachable_pub)?
-// TODO Clean up use and manipulation of toss Pos and Size
// TODO Remove unnecessary Debug impls and compare compile times
mod config;
diff --git a/src/ui/widgets/editor.rs b/src/ui/widgets/editor.rs
index 1aecd93..8de6cf0 100644
--- a/src/ui/widgets/editor.rs
+++ b/src/ui/widgets/editor.rs
@@ -497,11 +497,7 @@ impl Editor {
impl Widget for Editor {
fn size(&self, frame: &mut Frame, max_width: Option<u16>, max_height: Option<u16>) -> Size {
if let Some(placeholder) = &self.hidden {
- let mut size = if self.text.text().is_empty() {
- Size::new(1, 1)
- } else {
- placeholder.size(frame, max_width, max_height)
- };
+ let mut size = placeholder.size(frame, max_width, max_height);
// Cursor needs to fit regardless of focus
size.width = size.width.max(1);