aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_session.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-02-11 22:37:38 -0500
committerGitHub <noreply@github.com>2021-02-11 22:37:38 -0500
commit52397aaa0d1e2d4ce1320c73761cf316fc608ffb (patch)
tree647d32b73f0c9568acade1ed6e4d4e023c9c871b /src/nvim/ex_session.c
parent393095c1c69de922530871f74869433327b247b6 (diff)
parent4bc82a59b6fc3927ce20c7cadb080ed1c9d6fce8 (diff)
downloadrneovim-52397aaa0d1e2d4ce1320c73761cf316fc608ffb.tar.gz
rneovim-52397aaa0d1e2d4ce1320c73761cf316fc608ffb.tar.bz2
rneovim-52397aaa0d1e2d4ce1320c73761cf316fc608ffb.zip
Merge pull request #13491 from seandewar/vim-8.2.1967
vim-patch:8.2.{1967,2058,2467}
Diffstat (limited to 'src/nvim/ex_session.c')
-rw-r--r--src/nvim/ex_session.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index 14dac9a126..63789b3981 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -384,6 +384,18 @@ static int put_view(
xfree(fname_esc);
}
+ if (wp->w_alt_fnum) {
+ buf_T *const alt = buflist_findnr(wp->w_alt_fnum);
+
+ // Set the alternate file.
+ if ((flagp == &ssop_flags) && alt != NULL && alt->b_fname != NULL
+ && *alt->b_fname != NUL
+ && (fputs("balt ", fd) < 0
+ || ses_fname(fd, alt, flagp, true) == FAIL)) {
+ return FAIL;
+ }
+ }
+
//
// Local mappings and abbreviations.
//
@@ -438,9 +450,9 @@ static int put_view(
"let s:l = %" PRId64 " - ((%" PRId64
" * winheight(0) + %" PRId64 ") / %" PRId64 ")\n"
"if s:l < 1 | let s:l = 1 | endif\n"
- "exe s:l\n"
+ "keepjumps exe s:l\n"
"normal! zt\n"
- "%" PRId64 "\n",
+ "keepjumps %" PRId64 "\n",
(int64_t)wp->w_cursor.lnum,
(int64_t)(wp->w_cursor.lnum - wp->w_topline),
(int64_t)(wp->w_height_inner / 2),