comparison src/redisplay.c @ 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 b6c506c30f93
children bd4d2c8ef9cc
comparison
equal deleted inserted replaced
5782:7277cf461612 5783:cfc6a8c144f1
8285 /* Do not take into account the value of vertical_clip here. 8285 /* Do not take into account the value of vertical_clip here.
8286 That is the responsibility of the calling functions. */ 8286 That is the responsibility of the calling functions. */
8287 if (pixheight < 0) 8287 if (pixheight < 0)
8288 { 8288 {
8289 w->line_cache_validation_override--; 8289 w->line_cache_validation_override--;
8290 if (-pixheight > point_line_height) 8290 /* I see no reason why cur_pos can't be before BEGV
8291 /* We can't make the target line cover pixpos, so put it 8291 here, so check for it. It's not clear to me whether
8292 above pixpos. That way it will at least be visible. */ 8292 prev_pos could be before BEGV, so check that as well. */
8293 return prev_pos; 8293 if (-pixheight > point_line_height)
8294 else 8294 /* We can't make the target line cover pixpos, so put it
8295 return cur_pos; 8295 above pixpos. That way it will at least be visible. */
8296 return (prev_pos <= BUF_BEGV (b)) ? BUF_BEGV (b) : prev_pos;
8297 else
8298 return (cur_pos <= BUF_BEGV (b)) ? BUF_BEGV (b) : cur_pos;
8296 } 8299 }
8297 8300
8298 cur_elt--; 8301 cur_elt--;
8299 while (cur_elt < 0) 8302 while (cur_elt < 0)
8300 { 8303 {