From 3a7cb72dcbe4aaaed47999ab5afaf3d1cb8d4df8 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 20 Sep 2023 13:42:37 +0200 Subject: refactor(grid): properly namespace and separate stateful grid functions This is a step in an ongoing refactor where the "grid_puts" and "grid_put_linebuf" code paths will share more of the implementation (in particular for delta calculation, doublewidth and 'arabicshape' handling). But it also makes sense by its own as a cleanup, and is thus committed separately. Before this change many of the low level grid functions grid_puts, grid_fill etc could both be used in a standalone fashion but also as part of a batched line update which would be finally transmitted as a single grid_line call (via ui_line() ). This was initially useful to quickly refactor pre-existing vim code to use batched logic safely. However, this pattern is not really helpful for maintainable and newly written code, where the "grid" and "row" arguments are just needlessly repeated. This simplifies these calls to just use grid and row as specified in the initial grid_line_start(grid, row) call. This also makes the intent clear whether any grid_puts() call is actually part of a batch or not, which is better in the long run when more things get refactored to use effective (properly batched) updates. --- src/nvim/version.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/nvim/version.c') diff --git a/src/nvim/version.c b/src/nvim/version.c index b6861142cc..0744a601bb 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -2837,12 +2837,6 @@ void intro_message(int colon) } } } - - // Make the wait-return message appear just below the text. - if (colon) { - assert(row <= INT_MAX); - msg_row = (int)row; - } } static void do_intro_line(long row, char *mesg, int attr) @@ -2871,8 +2865,8 @@ static void do_intro_line(long row, char *mesg, int attr) l += utfc_ptr2len(p + l) - 1; } assert(row <= INT_MAX && col <= INT_MAX); - grid_puts_len(&default_grid, p, l, (int)row, (int)col, - *p == '<' ? HL_ATTR(HLF_8) : attr); + grid_puts(&default_grid, p, l, (int)row, (int)col, + *p == '<' ? HL_ATTR(HLF_8) : attr); col += clen; } } -- cgit