tags 25792 patch quit Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 25792@debbugs.gnu.org, alexanderm@web.de >> Date: Mon, 20 Feb 2017 12:42:58 -0500 >> >> The difference seems to be that try_window returns -1 in the case where >> we correctly stay out of the margin, but 1 in the case where we cross >> into it. I tried adding a partial_line_height call, but it's not giving >> the right answer. The move_it_to (&it, ZV, -1, it.last_visible_y, -1, >> MOVE_TO_POS | MOVE_TO_Y) call doesn't stop at last_visible_y, it goes to >> the end of buffer, so the returned partial height is a very large number >> (approx 6500 in my test). > > Probably because it.current_y is already beyond it.last_visible_y, due > to the loop before the call: Ah, right. > Does it work to call start_display again, before the call to > partial_line_height? Yes, here's a patch: