Mercurial > vim
comparison src/session.c @ 22776:0583f3e2c12e v8.2.1936
patch 8.2.1936: session sets the local 'scrolloff' value to the global value
Commit: https://github.com/vim/vim/commit/388908352f88e7391accb3545b082db0fc89d9f7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 1 17:40:54 2020 +0100
patch 8.2.1936: session sets the local 'scrolloff' value to the global value
Problem: Session sets the local 'scrolloff' value to the global value.
Solution: Do not let restoring the global option value change the local
value.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 Nov 2020 17:45:04 +0100 |
parents | e82579016863 |
children | 7c1e2e3f2d8d |
comparison
equal
deleted
inserted
replaced
22775:a3e03821096a | 22776:0583f3e2c12e |
---|---|
1214 || makeset(fd, OPT_GLOBAL, FALSE) == FAIL); | 1214 || makeset(fd, OPT_GLOBAL, FALSE) == FAIL); |
1215 | 1215 |
1216 #ifdef FEAT_SESSION | 1216 #ifdef FEAT_SESSION |
1217 if (!failed && view_session) | 1217 if (!failed && view_session) |
1218 { | 1218 { |
1219 if (put_line(fd, "let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0") == FAIL) | 1219 if (put_line(fd, "let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1") == FAIL) |
1220 failed = TRUE; | 1220 failed = TRUE; |
1221 if (eap->cmdidx == CMD_mksession) | 1221 if (eap->cmdidx == CMD_mksession) |
1222 { | 1222 { |
1223 char_u *dirnow; // current directory | 1223 char_u *dirnow; // current directory |
1224 | 1224 |
1259 else | 1259 else |
1260 { | 1260 { |
1261 failed |= (put_view(fd, curwin, !using_vdir, flagp, -1, NULL) | 1261 failed |= (put_view(fd, curwin, !using_vdir, flagp, -1, NULL) |
1262 == FAIL); | 1262 == FAIL); |
1263 } | 1263 } |
1264 if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save") | 1264 if (put_line(fd, "let &g:so = s:so_save | let &g:siso = s:siso_save") |
1265 == FAIL) | 1265 == FAIL) |
1266 failed = TRUE; | 1266 failed = TRUE; |
1267 #ifdef FEAT_SEARCH_EXTRA | 1267 #ifdef FEAT_SEARCH_EXTRA |
1268 if (no_hlsearch && put_line(fd, "nohlsearch") == FAIL) | 1268 if (no_hlsearch && put_line(fd, "nohlsearch") == FAIL) |
1269 failed = TRUE; | 1269 failed = TRUE; |