This commit is contained in:
Justin M. Keyes 2020-01-26 05:08:12 -08:00
parent 2070c082b5
commit 9048627806
2 changed files with 19 additions and 21 deletions

View File

@ -9210,7 +9210,7 @@ static int makeopens(FILE *fd, char_u *dirnow)
// temporarily to avoid that. // temporarily to avoid that.
if (p_stal == 1 && first_tabpage->tp_next != NULL) { if (p_stal == 1 && first_tabpage->tp_next != NULL) {
PUTLINE_FAIL("set stal=2"); PUTLINE_FAIL("set stal=2");
restore_stal = TRUE; restore_stal = true;
} }
// //
@ -9482,18 +9482,18 @@ static int ses_win_rec(FILE *fd, frame_T *fr)
// to split. // to split.
if (fprintf(fd, "%s%s", if (fprintf(fd, "%s%s",
"wincmd _ | wincmd |\n", "wincmd _ | wincmd |\n",
(fr->fr_layout == FR_COL ? "split\n" : "vsplit\n") (fr->fr_layout == FR_COL ? "split\n" : "vsplit\n")) < 0) {
) < 0) {
return FAIL; return FAIL;
} }
++count; count++;
} }
// Go back to the first window. // Go back to the first window.
if (count > 0 && (fprintf(fd, fr->fr_layout == FR_COL if (count > 0 && (fprintf(fd, fr->fr_layout == FR_COL
? "%dwincmd k" : "%dwincmd h", count) < 0 ? "%dwincmd k" : "%dwincmd h", count) < 0
|| put_eol(fd) == FAIL)) || put_eol(fd) == FAIL)) {
return FAIL; return FAIL;
}
// Recursively create frames/windows in each window of this column or row. // Recursively create frames/windows in each window of this column or row.
frc = ses_skipframe(fr->fr_child); frc = ses_skipframe(fr->fr_child);
@ -9501,8 +9501,9 @@ static int ses_win_rec(FILE *fd, frame_T *fr)
ses_win_rec(fd, frc); ses_win_rec(fd, frc);
frc = ses_skipframe(frc->fr_next); frc = ses_skipframe(frc->fr_next);
// Go to next window. // Go to next window.
if (frc != NULL && put_line(fd, "wincmd w") == FAIL) if (frc != NULL && put_line(fd, "wincmd w") == FAIL) {
return FAIL; return FAIL;
}
} }
} }
return OK; return OK;
@ -9694,9 +9695,9 @@ put_view(
if (f == FAIL) if (f == FAIL)
return FAIL; return FAIL;
/* //
* Save Folds when 'buftype' is empty and for help files. // Save Folds when 'buftype' is empty and for help files.
*/ //
if ((*flagp & SSOP_FOLDS) if ((*flagp & SSOP_FOLDS)
&& wp->w_buffer->b_ffname != NULL && wp->w_buffer->b_ffname != NULL
&& (bt_normal(wp->w_buffer) || bt_help(wp->w_buffer)) && (bt_normal(wp->w_buffer) || bt_help(wp->w_buffer))
@ -9705,11 +9706,10 @@ put_view(
return FAIL; return FAIL;
} }
/* //
* Set the cursor after creating folds, since that moves the cursor. // Set the cursor after creating folds, since that moves the cursor.
*/ //
if (do_cursor) { if (do_cursor) {
// Restore the cursor line in the file and relatively in the // Restore the cursor line in the file and relatively in the
// window. Don't use "G", it changes the jumplist. // window. Don't use "G", it changes the jumplist.
if (fprintf(fd, if (fprintf(fd,
@ -9718,14 +9718,12 @@ put_view(
"if s:l < 1 | let s:l = 1 | endif\n" "if s:l < 1 | let s:l = 1 | endif\n"
"exe s:l\n" "exe s:l\n"
"normal! zt\n" "normal! zt\n"
"%" PRId64 "\n" "%" PRId64 "\n",
,
(int64_t)wp->w_cursor.lnum, (int64_t)wp->w_cursor.lnum,
(int64_t)(wp->w_cursor.lnum - wp->w_topline), (int64_t)(wp->w_cursor.lnum - wp->w_topline),
(int64_t)(wp->w_height_inner / 2), (int64_t)(wp->w_height_inner / 2),
(int64_t)wp->w_height_inner, (int64_t)wp->w_height_inner,
(int64_t)wp->w_cursor.lnum (int64_t)wp->w_cursor.lnum) < 0) {
) < 0) {
return FAIL; return FAIL;
} }
// Restore the cursor column and left offset when not wrapping. // Restore the cursor column and left offset when not wrapping.
@ -9791,8 +9789,8 @@ static int ses_arglist(FILE *fd, char *cmd, garray_T *gap, int fullname,
return FAIL; return FAIL;
} }
PUTLINE_FAIL("%argdel"); PUTLINE_FAIL("%argdel");
for (int i = 0; i < gap->ga_len; ++i) { for (int i = 0; i < gap->ga_len; i++) {
/* NULL file names are skipped (only happens when out of memory). */ // NULL file names are skipped (only happens when out of memory).
s = alist_name(&((aentry_T *)gap->ga_data)[i]); s = alist_name(&((aentry_T *)gap->ga_data)[i]);
if (s != NULL) { if (s != NULL) {
if (fullname) { if (fullname) {

View File

@ -578,7 +578,7 @@ static char *(p_ssop_values[]) = {
# define SSOP_BLANK 0x080 # define SSOP_BLANK 0x080
# define SSOP_GLOBALS 0x100 # define SSOP_GLOBALS 0x100
# define SSOP_SLASH 0x200 # define SSOP_SLASH 0x200
# define SSOP_UNIX 0x400 /* Deprecated, not used. */ # define SSOP_UNIX 0x400 // Deprecated, not used.
# define SSOP_SESDIR 0x800 # define SSOP_SESDIR 0x800
# define SSOP_CURDIR 0x1000 # define SSOP_CURDIR 0x1000
# define SSOP_FOLDS 0x2000 # define SSOP_FOLDS 0x2000