ViEditor: redraw when passthrough mode changed

This commit is contained in:
Jeremy Soller 2023-11-01 14:17:37 -06:00
parent 7855dce09d
commit ca35e1f429
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -60,10 +60,13 @@ impl<'a> ViEditor<'a> {
/// Set passthrough mode (true will turn off vi features) /// Set passthrough mode (true will turn off vi features)
pub fn set_passthrough(&mut self, passthrough: bool) { pub fn set_passthrough(&mut self, passthrough: bool) {
if passthrough { if passthrough != (self.mode == ViMode::Passthrough) {
self.mode = ViMode::Passthrough; if passthrough {
} else { self.mode = ViMode::Passthrough;
self.mode = ViMode::Normal; } else {
self.mode = ViMode::Normal;
}
self.buffer_mut().set_redraw(true);
} }
} }