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,11 +60,14 @@ 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 != (self.mode == ViMode::Passthrough) {
if passthrough { if passthrough {
self.mode = ViMode::Passthrough; self.mode = ViMode::Passthrough;
} else { } else {
self.mode = ViMode::Normal; self.mode = ViMode::Normal;
} }
self.buffer_mut().set_redraw(true);
}
} }
/// Get current vi editing mode /// Get current vi editing mode