neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 90b1202cfb66096173188f136335d0a871da067e
parent f0b9232ad80804d85395130c54f1b8f671582c2c
Author: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Date:   Sat, 11 Oct 2025 00:44:38 -0400

vim-patch:8.2.4851: compiler warning for uninitialized variable

Problem:    Compiler warning for uninitialized variable.
Solution:   Use another variable to decide to restore option values.

https://github.com/vim/vim/commit/b4011afe53ce2d065e49718b8c5b9974b7022f92

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Diffstat:
Msrc/nvim/ex_session.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c @@ -710,6 +710,7 @@ static int makeopens(FILE *fd, char *dirnow) // Assume "tabpages" is in 'sessionoptions'. If not then we only do // "curtab" and bail out of the loop. + bool restore_height_width = false; FOR_ALL_TABS(tp) { bool need_tabnext = false; int cnr = 1; @@ -810,6 +811,7 @@ static int makeopens(FILE *fd, char *dirnow) "set winwidth=1\n") < 0) { return FAIL; } + restore_height_width = true; } if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL) { return FAIL; @@ -900,7 +902,7 @@ static int makeopens(FILE *fd, char *dirnow) PUTLINE_FAIL("let &shortmess = s:shortmess_save"); } - if (tab_firstwin != NULL && tab_firstwin->w_next != NULL) { + if (restore_height_width) { // Restore 'winminheight' and 'winminwidth'. PUTLINE_FAIL("let &winminheight = s:save_winminheight"); PUTLINE_FAIL("let &winminwidth = s:save_winminwidth");