Skip to content

Commit 290039b

Browse files
authored
make scrolling more efficient
1 parent 1250baf commit 290039b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod util;
33
use cursive::{
44
event::Key,
55
theme::{BaseColor, Color},
6-
view::{Nameable, Resizable},
6+
view::{Nameable, Resizable, ScrollStrategy},
77
views::{
88
Button, Dialog, DummyView, EditView, LinearLayout, ListView, OnEventView, Panel,
99
ScrollView, TextView,
@@ -68,7 +68,7 @@ Utilizes the \"cursive\" crate for building TUIs.
6868
.child(
6969
TextView::new(
7070
"
71-
v. 0.2.7 - GPLv3 License ",
71+
v. 0.2.9 - GPLv3 License ",
7272
)
7373
.style(Color::Dark(BaseColor::Blue)),
7474
),
@@ -115,7 +115,7 @@ Code length: {pass_len}"
115115
.fixed_width(pass_len as usize + 1),
116116
);
117117

118-
let list = Panel::new(ScrollView::new(ListView::new()).with_name("list"))
118+
let list = Panel::new(ScrollView::new(ListView::new()).scroll_strategy(ScrollStrategy::StickToBottom).with_name("list"))
119119
.fixed_height(12)
120120
.fixed_width(2 * (pass_len as usize) + 14);
121121
let game_sidebar = LinearLayout::vertical()

src/logic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ fn print_feedback(s: &mut Cursive, guess: &str, feedback: String) {
101101
len_fmt = guess.len() + 4
102102
)),
103103
);
104-
v.scroll_to_bottom();
105104
});
106105

107106
if feedback.chars().all(|c| c == '!') {

0 commit comments

Comments
 (0)