Run BufReadFifo hook after reading from fifo
This commit is contained in:
parent
8795a56731
commit
05b4d95a56
|
@ -1100,6 +1100,9 @@ existing hooks are:
|
||||||
* `BufWritePost`: Executed just after a buffer is written, filename is
|
* `BufWritePost`: Executed just after a buffer is written, filename is
|
||||||
used for filtering.
|
used for filtering.
|
||||||
* `BufClose`: Executed when a buffer is deleted, while it is still valid.
|
* `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
|
* `BufCloseFifo`: Executed when a fifo buffer closes its fifo file descriptor
|
||||||
either because the buffer is being deleted, or because the writing
|
either because the buffer is being deleted, or because the writing
|
||||||
end has been closed.
|
end has been closed.
|
||||||
|
|
|
@ -155,6 +155,8 @@ Buffer* create_fifo_buffer(String name, int fd, bool scroll)
|
||||||
while (--loops and count > 0 and
|
while (--loops and count > 0 and
|
||||||
select(fifo+1, &rfds, nullptr, nullptr, &tv) == 1);
|
select(fifo+1, &rfds, nullptr, nullptr, &tv) == 1);
|
||||||
|
|
||||||
|
buffer->run_hook_in_own_context("BufReadFifo", buffer->name());
|
||||||
|
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
buffer->values().erase(fifo_watcher_id); // will delete this
|
buffer->values().erase(fifo_watcher_id); // will delete this
|
||||||
}), std::move(watcher_deleter));
|
}), std::move(watcher_deleter));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user