hide cursor again after external editor closes (fixes #168)

This commit is contained in:
Stephan Dilly 2020-07-04 15:40:52 +02:00
parent 313f5586b0
commit 756c124b68

View File

@ -39,7 +39,7 @@ use crossterm::{
},
ExecutableCommand,
};
use input::{Input, InputEvent};
use input::{Input, InputEvent, InputState};
use profiler::Profiler;
use scopeguard::defer;
use scopetime::scope_time;
@ -129,7 +129,14 @@ fn main() -> Result<()> {
scope_time!("loop");
match event {
QueueEvent::InputEvent(ev) => app.event(ev)?,
QueueEvent::InputEvent(ev) => {
if let InputEvent::State(InputState::Polling) = ev
{
//Note: external ed closed, we need to re-hide cursor
terminal.hide_cursor()?;
}
app.event(ev)?
}
QueueEvent::Tick => app.update()?,
QueueEvent::GitEvent(ev) => app.update_git(ev)?,
QueueEvent::SpinnerUpdate => unreachable!(),