Run BufReadFifo hook after reading from fifo

This commit is contained in:
Maxime Coste 2015-06-28 11:06:19 +01:00
parent 8795a56731
commit 05b4d95a56
2 changed files with 5 additions and 0 deletions

View File

@ -1100,6 +1100,9 @@ existing hooks are:
* `BufWritePost`: Executed just after a buffer is written, filename is
used for filtering.
* `BufClose`: Executed when a buffer is deleted, while it is still valid.
* `BufOpenFifo`: Executed when a buffer opens a fifo.
* `BufReadFifo`: Executed after some data has been red from a fifo and
inserted in the buffer.
* `BufCloseFifo`: Executed when a fifo buffer closes its fifo file descriptor
either because the buffer is being deleted, or because the writing
end has been closed.

View File

@ -155,6 +155,8 @@ Buffer* create_fifo_buffer(String name, int fd, bool scroll)
while (--loops and count > 0 and
select(fifo+1, &rfds, nullptr, nullptr, &tv) == 1);
buffer->run_hook_in_own_context("BufReadFifo", buffer->name());
if (count <= 0)
buffer->values().erase(fifo_watcher_id); // will delete this
}), std::move(watcher_deleter));