Scroll on text input

This commit is contained in:
Jeremy Soller 2023-12-20 15:01:47 -07:00
parent f9f7904117
commit 7f181d0e64
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
3 changed files with 27 additions and 22 deletions

View file

@ -290,10 +290,15 @@ impl Terminal {
self.with_buffer_mut(|buffer| buffer.set_redraw(redraw));
}
pub fn input<I: Into<Cow<'static, [u8]>>>(&self, input: I) {
pub fn input_no_scroll<I: Into<Cow<'static, [u8]>>>(&self, input: I) {
self.notifier.notify(input);
}
pub fn input_scroll<I: Into<Cow<'static, [u8]>>>(&self, input: I) {
self.input_no_scroll(input);
self.scroll(TerminalScroll::Bottom);
}
pub fn resize(&mut self, width: u32, height: u32, scale_factor: f32) {
//TODO: check scale factor
if width != self.size.width || height != self.size.height {