summaryrefslogtreecommitdiff
path: root/src/event_manager.cc
AgeCommit message (Collapse)Author
2024-11-22Take a timeout argument in EventManager::handle_next_eventsMaxime Coste
When provided, this gives the maximal time to wait before exiting handle_next_events. If not given handle_next_events will block, this provides a more flexible approach than the previous "block" boolean. Use this to wait for a millisecond between each try to open a fifo for writing. Fixes the 100% cpu usage discussed in github on commit e74a3ac6a3bad1b74af71aa0bfdacb41ffcb7355
2023-12-26Small code style tweakMaxime Coste
2023-05-21Add <c-g> to cancel current operationMaxime Coste
The current implementation only does this during regex operations, but should be extensible to other operations that might take a long time by regularly calling EventManager::handle_urgent_events().
2021-03-11Do not select on non-urgent fd when handling only urgent eventsMaxime Coste
This avoids 100% CPU usage when we have pending fifo input while running a shell process, as we will not end-up busy looping in pselect but not reading the available data due to being only processing urgent events.
2020-09-18Add illumos/Solaris supportluka null
2019-02-27Fixed all reorder warningsJustin Frank
2018-06-03EventManager: Never block if a forced file descriptor is presentMaxime Coste
2018-05-17Handle all pending events before redrawingMaxime Coste
If new events happen while handling events, take care of those new events as well before redrawing.
2018-01-21Do not block when waiting for next event if we have pending inputMaxime Coste
Handle next event should never block if we have already accumulated input that we want to process. As we can accumulate new input in lots of places (everytime we run a shell process for example, we might end up reading input keys. That can be triggered during the mode line generation which takes place during display of the window) Fixes #1804
2017-08-29Rename containers.hh to ranges.hh (and Container to Range)Maxime Coste
2017-03-15Migrate WithBitOps template specialization to with_bit_ops functionMaxime Coste
This way we dont depend on knowing the base template to enable bit ops on an enum type.
2016-12-06Ensure timers are still alive when trying to run themMaxime Coste
2016-12-01Make FDWatcher support Read, Write and Except events, instead of just ReadMaxime Coste
2016-01-10Rename set_signal_wrapper to set_signal_handler and tweak SignalHandler defMaxime Coste
2015-12-23Add a signal function using sigactionDaniel Robertson
Use a wrapper for sigaction in place of signal to ensure that the SA_RESTART flag is set for all signals used. Signed-off-by: Daniel Robertson <danlrobertson89@gmail.com>
2015-06-09Fix race condition ShellManager::eval with SIGCHLDMaxime Coste
2015-06-09Fix commentMaxime Coste
2015-06-08Do not close stderr/stdout before program finishMaxime Coste
Programs like grep called in '$' command will fail due to SIGPIPE for example. So we need to keep the pipe open.
2014-12-23Move containers utils to containers.hh and add filtered/transformed utilsMaxime Coste
2014-12-18Do not register timers for transient input handlersMaxime Coste
2014-12-12Avoid very long timeouts in event managerMaxime Coste
2014-12-09Get rid of uses of unordered_set, vector is just simpler and faster...Maxime Coste
2014-12-04Refactor (again) event handling, use proper infinite timeoutMaxime Coste
2014-12-03Limit event handler timeout to 2 secondsMaxime Coste
2014-12-03Microsecond is 10^(-6)s, not 10^(-9)sMaxime Coste
2014-12-03Fix timeval field typesMaxime Coste
2014-12-03Use a select based event handling and fix deadlockMaxime Coste
2014-11-29Rework client pending key handling, fix insert/normal timersMaxime Coste
2014-11-25Separate events between normal and urgent onesMaxime Coste
Run urgent ones while executing %sh blocks. Fixes #236
2014-11-24Style tweakMaxime Coste
2014-08-17Get forced file descriptors after calling pollMaxime Coste
That way, we do not wait for the next poll to finish before servicing forced fd triggered by a signal that interupted the poll call.
2014-08-14Add support for running kakoune as a filter, using -f 'keys'Maxime Coste
It will cycle on every given files, apply the keys and write to <filename>.kak-out. Only normal/insert mode is available, kakrc are not read.
2014-08-12Defer deletion of buffers to after the event loopMaxime Coste
We can have SelectionList in flights on the buffer, so mark it for deletion by moving it in a buffer trash, and effectively delete it later, at a point where there should not be any further access to it.
2014-03-18EventManager: fix busy loop when no timer events exists.Maxime Coste
2014-02-12EventManager now wakes up for next timer rather than running a 10HzMaxime Coste
2013-09-23small optimization in event managerMaxime Coste
2013-09-17Only redraw clients after handling all available eventsMaxime Coste
2013-04-09rename assert to kak_assert to avoid collisionsMaxime Coste
2013-01-31Remove Set and use unordered_setMaxime Coste
2013-01-14EventManager: add support for timersMaxime Coste
2013-01-11Add and use a Set template class for recuring small setsMaxime Coste
2013-01-10Refactor EventManagerMaxime Coste
Watching a file descriptor is now done using a FDWatcher object
2013-01-04various code style fixesMaxime Coste
2012-12-03EventManager: fix forced event processingMaxime Coste
previous implementation could drop some forced events.
2012-11-27EventManager: refactor (again)Maxime Coste
2012-11-26EventManager: avoid erasing an event handler while it may be in useMaxime Coste
2012-11-06EventManager: store event handlers in an unordered_map instead of a vectorMaxime Coste
If an event handler add or removes an event from the manager, it may then be moved in the vector, and if after that it access any of it's members (through this), it results in an invalid memory access.
2012-10-27EventManager: handle forced events even when poll return -1Maxime Coste
2012-10-27EventManager: add force_signal method to force event executionMaxime Coste
2012-09-12rework fifo handling, use real fifos in {make,grep}.kak, update READMEMaxime Coste