Mercurial > vim
comparison src/session.c @ 28654:8fc86c943863 v8.2.4851
patch 8.2.4851: compiler warning for uninitialized variable
Commit: https://github.com/vim/vim/commit/b4011afe53ce2d065e49718b8c5b9974b7022f92
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 1 00:42:24 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 May 2022 01:45:04 +0200 |
parents | 27dcbe70e1f0 |
children | d0241e74bfdb |
comparison
equal
deleted
inserted
replaced
28653:94f2550a1af1 | 28654:8fc86c943863 |
---|---|
618 { | 618 { |
619 buf_T *buf; | 619 buf_T *buf; |
620 int only_save_windows = TRUE; | 620 int only_save_windows = TRUE; |
621 int nr; | 621 int nr; |
622 int restore_size = TRUE; | 622 int restore_size = TRUE; |
623 int restore_height_width = FALSE; | |
623 win_T *wp; | 624 win_T *wp; |
624 char_u *sname; | 625 char_u *sname; |
625 win_T *edited_win = NULL; | 626 win_T *edited_win = NULL; |
626 int restore_stal = FALSE; | 627 int restore_stal = FALSE; |
627 win_T *tab_firstwin; | 628 win_T *tab_firstwin; |
885 if (put_line(fd, "set winminheight=0") == FAIL | 886 if (put_line(fd, "set winminheight=0") == FAIL |
886 || put_line(fd, "set winheight=1") == FAIL | 887 || put_line(fd, "set winheight=1") == FAIL |
887 || put_line(fd, "set winminwidth=0") == FAIL | 888 || put_line(fd, "set winminwidth=0") == FAIL |
888 || put_line(fd, "set winwidth=1") == FAIL) | 889 || put_line(fd, "set winwidth=1") == FAIL) |
889 goto fail; | 890 goto fail; |
891 restore_height_width = TRUE; | |
890 } | 892 } |
891 if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL) | 893 if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL) |
892 goto fail; | 894 goto fail; |
893 | 895 |
894 // Restore the tab-local working directory if specified | 896 // Restore the tab-local working directory if specified |
977 { | 979 { |
978 if (put_line(fd, "let &shortmess = s:shortmess_save") == FAIL) | 980 if (put_line(fd, "let &shortmess = s:shortmess_save") == FAIL) |
979 goto fail; | 981 goto fail; |
980 } | 982 } |
981 | 983 |
982 if (tab_firstwin->w_next != NULL) | 984 if (restore_height_width) |
983 { | 985 { |
984 // Restore 'winminheight' and 'winminwidth'. | 986 // Restore 'winminheight' and 'winminwidth'. |
985 if (put_line(fd, "let &winminheight = s:save_winminheight") == FAIL | 987 if (put_line(fd, "let &winminheight = s:save_winminheight") == FAIL |
986 || put_line(fd, "let &winminwidth = s:save_winminwidth") == FAIL) | 988 || put_line(fd, "let &winminwidth = s:save_winminwidth") == FAIL) |
987 goto fail; | 989 goto fail; |