Merge pull request #590 from rockorager/clear-sel

selection: only clear when keypress has utf8
This commit is contained in:
Mitchell Hashimoto
2023-09-29 15:17:48 -07:00
committed by GitHub

View File

@ -967,9 +967,9 @@ pub fn keyCallback(
}, .{ .forever = {} }); }, .{ .forever = {} });
try self.io_thread.wakeup.notify(); try self.io_thread.wakeup.notify();
// If we have a sequence to emit then we always want to clear the // If we have printable text to emit then we always want to clear the
// selection and scroll to the bottom. // selection and scroll to the bottom.
{ if (event.utf8.len > 0) {
self.renderer_state.mutex.lock(); self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock(); defer self.renderer_state.mutex.unlock();
self.setSelection(null); self.setSelection(null);