Mercurial > hg > xemacs-beta
changeset 5783:cfc6a8c144f1
Don't return a Charbpos before visible region, start_with_line_at_pixpos()
src/ChangeLog addition:
2014-01-21 Aidan Kehoe <kehoea@parhasard.net>
* redisplay.c (start_with_line_at_pixpos):
Apply Julian Bradfield's change of
slrnlc7tnv.l3h.jcb@home.stevens-bradfield.com , never returning a
Charbpos before the visible region. Thank you Julian!
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 21 Jan 2014 00:27:16 +0000 |
parents | 7277cf461612 |
children | 0cb4f494a548 |
files | src/ChangeLog src/redisplay.c |
diffstat | 2 files changed, 16 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Mon Jan 20 18:13:15 2014 +0000 +++ b/src/ChangeLog Tue Jan 21 00:27:16 2014 +0000 @@ -1,3 +1,10 @@ +2014-01-21 Aidan Kehoe <kehoea@parhasard.net> + + * redisplay.c (start_with_line_at_pixpos): + Apply Julian Bradfield's change of + slrnlc7tnv.l3h.jcb@home.stevens-bradfield.com , never returning a + Charbpos before the visible region. Thank you Julian! + 2014-01-20 Aidan Kehoe <kehoea@parhasard.net> * fileio.c (Fcopy_file, Finsert_file_contents_internal):
--- a/src/redisplay.c Mon Jan 20 18:13:15 2014 +0000 +++ b/src/redisplay.c Tue Jan 21 00:27:16 2014 +0000 @@ -8287,12 +8287,15 @@ if (pixheight < 0) { w->line_cache_validation_override--; - if (-pixheight > point_line_height) - /* We can't make the target line cover pixpos, so put it - above pixpos. That way it will at least be visible. */ - return prev_pos; - else - return cur_pos; + /* I see no reason why cur_pos can't be before BEGV + here, so check for it. It's not clear to me whether + prev_pos could be before BEGV, so check that as well. */ + if (-pixheight > point_line_height) + /* We can't make the target line cover pixpos, so put it + above pixpos. That way it will at least be visible. */ + return (prev_pos <= BUF_BEGV (b)) ? BUF_BEGV (b) : prev_pos; + else + return (cur_pos <= BUF_BEGV (b)) ? BUF_BEGV (b) : cur_pos; } cur_elt--;