diff options
author | Blaž Hrastnik | 2021-03-01 05:23:10 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-01 05:23:10 +0000 |
commit | 00808afe3c215d159574b23e30326379428060bf (patch) | |
tree | b9f4fdb9cf559e95340a625c7741e9dbcd31b41b /helix-term/src/terminal.rs | |
parent | 2c9b02039bac81cb32309bd0d4e2b08191356b9c (diff) |
ui: Make editor more resilient about being shrunk too small.
Diffstat (limited to 'helix-term/src/terminal.rs')
-rw-r--r-- | helix-term/src/terminal.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/helix-term/src/terminal.rs b/helix-term/src/terminal.rs index e40343bd..fc9bc5ba 100644 --- a/helix-term/src/terminal.rs +++ b/helix-term/src/terminal.rs @@ -154,7 +154,7 @@ where /// Synchronizes terminal size, calls the rendering closure, flushes the current internal state /// and prepares for the next draw call. - pub fn draw(&mut self) -> io::Result<()> { + pub fn draw(&mut self, cursor_position: Option<(u16, u16)>) -> io::Result<()> { // // Autoresize - otherwise we get glitches if shrinking or potential desync between widgets // // and the terminal (if growing), which may OOB. // self.autoresize()?; @@ -169,13 +169,13 @@ where // Draw to stdout self.flush()?; - // match cursor_position { - // None => self.hide_cursor()?, - // Some((x, y)) => { - // self.show_cursor()?; - // self.set_cursor(x, y)?; - // } - // } + match cursor_position { + None => self.hide_cursor()?, + Some((x, y)) => { + self.show_cursor()?; + self.set_cursor(x, y)?; + } + } // Swap buffers self.buffers[1 - self.current].reset(); |