From 35f5dc3b0ccabe664aae7f93c1a330cfc751f018 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 7 Oct 2023 10:36:46 +1100 Subject: [PATCH] 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 --- DOC/TODO.md | 2 +- render-lines.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 || -- 2.39.5