diff options
author | Dillard Robertson | 2023-08-15 03:19:24 +0000 |
---|---|---|
committer | GitHub | 2023-08-15 03:19:24 +0000 |
commit | ea886773945a0c0856ab5866dde3a3fdd459ed1d (patch) | |
tree | e1cd3223c0d25ec7dead7e40309a2780ce36e0c1 | |
parent | 2756f70dfc67bdfbd051a993db0c274027d56310 (diff) |
Stop Terminal::drop from overriding work of Terminal::restore. (#7931)
When Application::run is exiting, either Terminal::restore or
Terminal::force_restore will be called depending
on if a panic occured or not.
Both of these functions will reset the cursor to terminal's default.
After this is done, Terminal::drop will be called.
If terminal.cursor_kind == Hidden, then
the cursor will be reset to a CursorKind::Block,
undoing the work of restore or force_restore.
This commit just removes the drop implementation,
as its job is already better handled in restore and force_restore.
-rw-r--r-- | helix-tui/src/terminal.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/helix-tui/src/terminal.rs b/helix-tui/src/terminal.rs index 8b734275..d2a911cf 100644 --- a/helix-tui/src/terminal.rs +++ b/helix-tui/src/terminal.rs @@ -65,20 +65,6 @@ where viewport: Viewport, } -impl<B> Drop for Terminal<B> -where - B: Backend, -{ - fn drop(&mut self) { - // Attempt to restore the cursor state - if self.cursor_kind == CursorKind::Hidden { - if let Err(err) = self.show_cursor(CursorKind::Block) { - eprintln!("Failed to show the cursor: {}", err); - } - } - } -} - impl<B> Terminal<B> where B: Backend, |