mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
Switch interrupt_handler to return maybe_t<char_event_t>
Prepares to remove R_NULL
This commit is contained in:
@@ -249,7 +249,7 @@ void input_mapping_add(const wchar_t *sequence, const wchar_t *command, const wc
|
||||
|
||||
/// Handle interruptions to key reading by reaping finshed jobs and propagating the interrupt to the
|
||||
/// reader.
|
||||
static maybe_t<int> interrupt_handler() {
|
||||
static maybe_t<char_event_t> interrupt_handler() {
|
||||
// Fire any pending events.
|
||||
event_fire_delayed();
|
||||
// Reap stray processes, including printing exit status messages.
|
||||
@@ -260,10 +260,10 @@ static maybe_t<int> interrupt_handler() {
|
||||
if (vintr == 0) {
|
||||
return none();
|
||||
}
|
||||
return vintr;
|
||||
return char_event_t{vintr};
|
||||
}
|
||||
|
||||
return R_NULL;
|
||||
return char_event_t{R_NULL};
|
||||
}
|
||||
|
||||
static std::atomic<bool> input_initialized{false};
|
||||
|
||||
@@ -124,7 +124,7 @@ class char_event_t {
|
||||
|
||||
/// A type of function invoked on interrupt.
|
||||
/// \return the event which is to be returned to the reader loop, or none if VINTR is 0.
|
||||
using interrupt_func_t = maybe_t<int> (*)();
|
||||
using interrupt_func_t = maybe_t<char_event_t> (*)();
|
||||
|
||||
/// Init the library with an interrupt function.
|
||||
void input_common_init(interrupt_func_t func);
|
||||
|
||||
Reference in New Issue
Block a user