summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2021-11-13 12:58:23 +0000
committerAlan Mackenzie <acm@muc.de>2021-11-13 12:58:23 +0000
commitf740becf8ad1fdd992fb509edb10ff041f163c8f (patch)
treee9da301ef7ad61378920ff0ab529a4fbc781163c /src/fileio.c
parent102406edb1d387bcb3c82ac320c30da5bd705194 (diff)
downloademacs-f740becf8ad1fdd992fb509edb10ff041f163c8f.tar.gz
Correct patch from 2021-11-12 on src/fileio.c
* src/fileio.c (restore_window_points): Reverse commit 974192413f8a81171b8fd28dfd5c081ce06d3dec and instead replace a < by a <=. This ensures that if w->mpoint is at the top of the middle region being replaced, it gets adjusted and stays at the top after the reinsertion.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/fileio.c b/src/fileio.c
index a7b1649fae8..4015448ecee 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3827,20 +3827,17 @@ restore_window_points (Lisp_Object window_markers, ptrdiff_t inserted,
Lisp_Object car = XCAR (window_markers);
Lisp_Object marker = XCAR (car);
Lisp_Object oldpos = XCDR (car);
- ptrdiff_t newpos;
if (MARKERP (marker) && FIXNUMP (oldpos)
&& XFIXNUM (oldpos) > same_at_start
- && XFIXNUM (oldpos) < same_at_end)
+ && XFIXNUM (oldpos) <= same_at_end)
{
ptrdiff_t oldsize = same_at_end - same_at_start;
ptrdiff_t newsize = inserted;
double growth = newsize / (double)oldsize;
- newpos = same_at_start
- + growth * (XFIXNUM (oldpos) - same_at_start);
+ ptrdiff_t newpos
+ = same_at_start + growth * (XFIXNUM (oldpos) - same_at_start);
+ Fset_marker (marker, make_fixnum (newpos), Qnil);
}
- else
- newpos = XFIXNUM (oldpos);
- Fset_marker (marker, make_fixnum (newpos), Qnil);
}
}