1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2020-11-27 11:00:38 +01:00
parent fccbf068f8
commit 3482be6a33
4 changed files with 76 additions and 3 deletions

View File

@@ -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.