Skip to content

Commit 16a9ea4

Browse files
committed
Implement missing EditView::required_size
1 parent 010f6a5 commit 16a9ea4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cursive-core/src/views/edit_view.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,14 @@ impl View for EditView {
601601
}
602602
}
603603

604+
fn required_size(&mut self, constraint: Vec2) -> Vec2 {
605+
let content_width = self.content.width();
606+
constraint.or_min((content_width + 1, 1))
607+
}
608+
604609
fn layout(&mut self, size: Vec2) {
605610
self.last_length = size.x;
611+
self.keep_cursor_in_view();
606612
}
607613

608614
fn take_focus(&mut self, _: Direction) -> Result<EventResult, CannotFocus> {

0 commit comments

Comments
 (0)