diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2024-02-07 17:17:44 +0000 |
|---|---|---|
| committer | Sean Dewar <6256228+seandewar@users.noreply.github.com> | 2024-03-08 23:24:03 +0000 |
| commit | 5d58136cccc760f6d95eb45b46f2ad60f06b103b (patch) | |
| tree | 6b58f8337b410a8cebb00bcaddd5631ac95f67b4 /src/nvim/tui | |
| parent | b1e24f240baeea80dcf4a3d8453fed0230fb88fd (diff) | |
| download | rneovim-5d58136cccc760f6d95eb45b46f2ad60f06b103b.tar.gz rneovim-5d58136cccc760f6d95eb45b46f2ad60f06b103b.tar.bz2 rneovim-5d58136cccc760f6d95eb45b46f2ad60f06b103b.zip | |
fix(api): make open_win/win_set_config check if splitting allowed
Problem: splitting is disallowed in some cases to prevent the window layout
changes while a window is closing, but it's not checked for.
Solution: check for this, and set the API error message directly.
(Also sneak in a change to tui.c that got lost from #27352; it's a char* buf,
and the memset is assuming one byte each anyway)
Diffstat (limited to 'src/nvim/tui')
| -rw-r--r-- | src/nvim/tui/tui.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 7fae34d33f..c332c17e43 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1643,7 +1643,7 @@ static void invalidate(TUIData *tui, int top, int bot, int left, int right) static void ensure_space_buf_size(TUIData *tui, size_t len) { if (len > tui->space_buf_len) { - tui->space_buf = xrealloc(tui->space_buf, len * sizeof *tui->space_buf); + tui->space_buf = xrealloc(tui->space_buf, len); memset(tui->space_buf + tui->space_buf_len, ' ', len - tui->space_buf_len); tui->space_buf_len = len; } |