diff src/session.c @ 23023:4384c44c031a v8.2.2058

patch 8.2.2058: using mkview/loadview changes the jumplist Commit: https://github.com/vim/vim/commit/3482be6a33c3a00fe1e8e604310ad3034f593045 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Nov 27 11:00:38 2020 +0100 patch 8.2.2058: using mkview/loadview changes the jumplist Problem: Using mkview/loadview changes the jumplist. Solution: Use ":keepjumps". Don't let ":badd" or ":balt" change the jumplist. (closes #7371)
author Bram Moolenaar <Bram@vim.org>
date Fri, 27 Nov 2020 11:15:06 +0100
parents 7c1e2e3f2d8d
children a2f13e56b0e7
line wrap: on
line diff
--- a/src/session.c
+++ b/src/session.c
@@ -460,9 +460,9 @@ put_view(
 		    (long)wp->w_height / 2, (long)wp->w_height) < 0
 		|| put_eol(fd) == FAIL
 		|| put_line(fd, "if s:l < 1 | let s:l = 1 | endif") == FAIL
-		|| put_line(fd, "exe s:l") == FAIL
+		|| put_line(fd, "keepjumps exe s:l") == FAIL
 		|| put_line(fd, "normal! zt") == FAIL
-		|| fprintf(fd, "%ld", (long)wp->w_cursor.lnum) < 0
+		|| fprintf(fd, "keepjumps %ld", (long)wp->w_cursor.lnum) < 0
 		|| put_eol(fd) == FAIL)
 	    return FAIL;
 	// Restore the cursor column and left offset when not wrapping.