From c3b01a3c9caf030a8c6f6dca56688aca57a9248e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 27 Nov 2024 11:13:35 +0100 Subject: 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. --- src/buffer_utils.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/buffer_utils.hh') 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); -- cgit v1.2.3