]> git.neil.brown.name Git - edlib.git/commitdiff
Fix redraw when requesting to display last line
authorNeilBrown <neil@brown.name>
Fri, 6 Oct 2023 23:36:46 +0000 (10:36 +1100)
committerNeilBrown <neil@brown.name>
Sun, 8 Oct 2023 08:10:25 +0000 (19:10 +1100)
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 <neil@brown.name>
DOC/TODO.md
render-lines.c

index 95d7d81c96036b60e57406fe196561562186e9b4..8543d8198098bcd752ac4691c60e0c18091ee2ad 100644 (file)
@@ -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!
index 6e5a85e3051faddf84bcfd1fa1fa0b3db082182c..89b60d14af0f2b1c273341d5dd1fe3df0f9ca316 100644 (file)
@@ -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 ||