From: NeilBrown Date: Fri, 6 Oct 2023 23:36:46 +0000 (+1100) Subject: Fix redraw when requesting to display last line X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=35f5dc3b0ccabe664aae7f93c1a330cfc751f018;p=edlib.git Fix redraw when requesting to display last line When we request to display the last line, we need to know if the last line is fully displayed. We previously assumed it wasn't, which created strange artifacts. We can know for certain, so add that test. Signed-off-by: NeilBrown --- diff --git a/DOC/TODO.md b/DOC/TODO.md index 95d7d81c..8543d819 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -9,7 +9,7 @@ the file. ### Triage -- [ ] when search succeeds near eof then trying again loops back to +- [X] when search succeeds on final line then trying again loops back to there, redraw is strange - [ ] There is a "window:close" and a "Window:close" and they are different. Fix this! diff --git a/render-lines.c b/render-lines.c index 6e5a85e3..89b60d14 100644 --- a/render-lines.c +++ b/render-lines.c @@ -1660,7 +1660,7 @@ DEF_CMD(render_lines_move_pos) /* top line not fully displayed, being in that line is * not sufficient */ top = vmark_next(top); - if (bot) + if (bot && rl->tail_height) /* last line might not be fully displayed, so don't assume */ bot = vmark_prev(bot); if (!top || !bot ||