mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #687 from mitchellh/cancel
renderer: handle error.NotFound for timer cancellation
This commit is contained in:
@ -382,11 +382,13 @@ fn cursorCancelCallback(
|
|||||||
// support different sets of errors, so we just unify it.
|
// support different sets of errors, so we just unify it.
|
||||||
const CancelError = xev.Timer.CancelError || error{
|
const CancelError = xev.Timer.CancelError || error{
|
||||||
Canceled,
|
Canceled,
|
||||||
|
NotFound,
|
||||||
Unexpected,
|
Unexpected,
|
||||||
};
|
};
|
||||||
|
|
||||||
_ = r catch |err| switch (@as(CancelError, @errorCast(err))) {
|
_ = r catch |err| switch (@as(CancelError, @errorCast(err))) {
|
||||||
error.Canceled => {},
|
error.Canceled => {}, // success
|
||||||
|
error.NotFound => {}, // completed before it could cancel
|
||||||
else => {
|
else => {
|
||||||
log.warn("error in cursor cancel callback err={}", .{err});
|
log.warn("error in cursor cancel callback err={}", .{err});
|
||||||
unreachable;
|
unreachable;
|
||||||
|
Reference in New Issue
Block a user