refactor(api): use an arena for nvim_buf_get_lines and buffer updates

Refactor some earlier "temporary Array" code in buffer_updates.c to use
the modern style of MAXSIZE_TEMP_ARRAY and ADD_C
This commit is contained in:
bfredl
2024-02-10 13:13:52 +01:00
parent ca258db156
commit 930d6e38d4
6 changed files with 81 additions and 117 deletions

View File

@@ -656,10 +656,10 @@ void nvim_set_current_dir(String dir, Error *err)
///
/// @param[out] err Error details, if any
/// @return Current line string
String nvim_get_current_line(Error *err)
String nvim_get_current_line(Arena *arena, Error *err)
FUNC_API_SINCE(1)
{
return buffer_get_line(curbuf->handle, curwin->w_cursor.lnum - 1, err);
return buffer_get_line(curbuf->handle, curwin->w_cursor.lnum - 1, arena, err);
}
/// Sets the current line.