From 2eb6aa9e20901c53ec7c288d47592043649b1bbd Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Sat, 5 Jul 2025 00:24:54 +0200 Subject: Introduce `history_since_` value expansion The `history_since_` value expansion allows incremental parsing of a buffer's history. declare-option int my_last_history_id define-command my-process-history ... # process the initial buffer history my-process-history %val{bufname} 0 %val{history} set-option buffer my_last_history_id 0 # only process new history changes on idle hook buffer NormalIdle %{ evaluate-commands %exp{ my-process-history \ %%val{bufname} \ %%opt{my_last_history_id} \ %%val{history_since_%opt{my_last_history_id}} } set-option buffer my_last_history_id %val{history_id} } --- src/buffer_utils.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer_utils.hh') diff --git a/src/buffer_utils.hh b/src/buffer_utils.hh index 96e89743..f677c34e 100644 --- a/src/buffer_utils.hh +++ b/src/buffer_utils.hh @@ -97,7 +97,7 @@ void write_buffer_to_backup_file(Buffer& buffer); void write_to_debug_buffer(StringView str); -Vector history_as_strings(const Vector& history); +Vector history_as_strings(ConstArrayView history); Vector undo_group_as_strings(const Buffer::UndoGroup& undo_group); String generate_buffer_name(StringView pattern); -- cgit v1.2.3