diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2024-11-27 11:13:35 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-11-28 08:11:06 +1100 |
| commit | c3b01a3c9caf030a8c6f6dca56688aca57a9248e (patch) | |
| tree | 469900699338fd49d8f78bae872c752ad16b1808 /src/buffer_utils.hh | |
| parent | 658915086fc4883c45f1af98f1b37a01822e9feb (diff) | |
Add back option to scroll in stdin buffers
Commit 582c3c56b (Do not add trailing newline to non-scrolling fifo
buffers, 2024-01-28) completely forgot about stdin buffers,
breaking the ability to make them scrolling via "ge".
For example
while sleep 1; do
seq $LINES
date
done | kak
Let's fix that by adding the trailing newline back for stdin buffers.
Unlike "edit -scroll", don't scroll until the user explicitly moves
the cursor.
Diffstat (limited to 'src/buffer_utils.hh')
| -rw-r--r-- | src/buffer_utils.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh index e0b40425..bc0dab68 100644 --- a/src/buffer_utils.hh +++ b/src/buffer_utils.hh @@ -72,7 +72,8 @@ ColumnCount column_length(const Buffer& buffer, ColumnCount tabstop, LineCount l ByteCount get_byte_to_column(const Buffer& buffer, ColumnCount tabstop, DisplayCoord coord); -Buffer* create_fifo_buffer(String name, int fd, Buffer::Flags flags, bool scroll = false); +enum class AutoScroll { No, NotInitially, Yes }; +Buffer* create_fifo_buffer(String name, int fd, Buffer::Flags flags, AutoScroll scroll); Buffer* create_buffer_from_string(String name, Buffer::Flags flags, StringView data); Buffer* open_file_buffer(StringView filename, Buffer::Flags flags = Buffer::Flags::None); |
