core: clear pending keyboard sequence when config reloads

This commit is contained in:
Mitchell Hashimoto
2024-08-19 12:33:21 -07:00
parent 454c585eb3
commit 99b3e2e844

View File

@ -889,6 +889,13 @@ fn changeConfig(self: *Surface, config: *const configpkg.Config) !void {
self.showMouse(); self.showMouse();
} }
// If we are in the middle of a key sequence, clear it.
self.keyboard.bindings = null;
if (self.keyboard.queued.items.len > 0) {
for (self.keyboard.queued.items) |req| req.deinit();
self.keyboard.queued.clearAndFree(self.alloc);
}
// Before sending any other config changes, we give the renderer a new font // Before sending any other config changes, we give the renderer a new font
// grid. We could check to see if there was an actual change to the font, // grid. We could check to see if there was an actual change to the font,
// but this is easier and pretty rare so it's not a performance concern. // but this is easier and pretty rare so it's not a performance concern.