diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-09-19 12:32:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-19 12:32:41 +0200 |
commit | 1db45a9c1fd68e57611829a9363212a39f3c55d6 (patch) | |
tree | 512daeff103353e06d8c82deaad4d5040b99d468 /src/nvim/msgpack_rpc/unpacker.c | |
parent | 2de5cddeb197502c8b3ecf5e7eb1ac929cc2307f (diff) | |
parent | 8da986ea877b07a5eb117446f410f2a7fc8cd9cb (diff) | |
download | rneovim-1db45a9c1fd68e57611829a9363212a39f3c55d6.tar.gz rneovim-1db45a9c1fd68e57611829a9363212a39f3c55d6.tar.bz2 rneovim-1db45a9c1fd68e57611829a9363212a39f3c55d6.zip |
Merge pull request #25214 from bfredl/glyphcache
refactor(grid): change schar_T representation to be more compact
Diffstat (limited to 'src/nvim/msgpack_rpc/unpacker.c')
-rw-r--r-- | src/nvim/msgpack_rpc/unpacker.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/msgpack_rpc/unpacker.c b/src/nvim/msgpack_rpc/unpacker.c index c3b1022db2..37e32729cc 100644 --- a/src/nvim/msgpack_rpc/unpacker.c +++ b/src/nvim/msgpack_rpc/unpacker.c @@ -9,6 +9,7 @@ #include "mpack/conv.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" +#include "nvim/grid.h" #include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/msgpack_rpc/channel_defs.h" @@ -497,13 +498,13 @@ redo: if (g->icell == g->ncells - 1 && cellsize == 1 && cellbuf[0] == ' ' && repeat > 1) { g->clear_width = repeat; } else { + schar_T sc = schar_from_buf(cellbuf, cellsize); for (int r = 0; r < repeat; r++) { if (g->coloff >= (int)grid_line_buf_size) { p->state = -1; return false; } - memcpy(grid_line_buf_char[g->coloff], cellbuf, cellsize); - grid_line_buf_char[g->coloff][cellsize] = NUL; + grid_line_buf_char[g->coloff] = sc; grid_line_buf_attr[g->coloff++] = g->cur_attr; } } |