Merge pull request #183 from agavrilov/FixWindowResizingInPancurses

Call resize_term on KeySize
This commit is contained in:
Alexandre Bury 2018-01-09 19:00:05 +01:00 committed by GitHub
commit 5d8a452b18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,7 +413,14 @@ impl backend::Backend for Concrete {
pancurses::Input::KeySUndo => Event::Refresh,
pancurses::Input::KeySuspend => Event::Refresh,
pancurses::Input::KeyUndo => Event::Refresh,
pancurses::Input::KeyResize => Event::WindowResize,
pancurses::Input::KeyResize => {
// Let pancurses adjust their structures when the window is resized.
// Do it for Windows only, as 'resize_term' is not implemented for Unix
if cfg!(target_os = "windows") {
pancurses::resize_term(0, 0);
}
Event::WindowResize
},
pancurses::Input::KeyEvent => Event::Refresh,
// TODO: mouse support
pancurses::Input::KeyMouse => self.parse_mouse_event(),