]> git.neil.brown.name Git - edlib.git/commitdiff
render-lines: avoid putting extra space at EOF for small pane
authorNeilBrown <neil@brown.name>
Fri, 18 Aug 2023 04:19:48 +0000 (14:19 +1000)
committerNeilBrown <neil@brown.name>
Fri, 18 Aug 2023 04:19:48 +0000 (14:19 +1000)
We normally add a bit of extra space at end-of-file.
I already had code to avoid this in small panes. But it wasn't working
as line_height_post hadn't been initialised usefully.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
render-lines.c

index 3dab99113aa48e6c0f3fff74fc4dc6593f2d6b74..71a0b7cc48f332a46740b6e0a261c6bf3d401ca2 100644 (file)
@@ -13,7 +13,7 @@ the file.
 - [ ] tabs can wrap around a newline - with part of tab at end of one
       line and part at start of the next.  Do I want that?  do_measure()
       decides.
-- [ ] in xcb, find-file draws result a pixel high, then moves done
+- [X] in xcb, find-file draws result a pixel high, then moves done
       when cursor moves
 - [ ] favourites...  I want some favourite documents that are easy to
       find, favourite directories, favourite make or shell commands.
index 0ec51df3d37ba2819b5b0a5b4e0d9ef5bd18b7d7..bf1361953f520cbeae69c8e3aac14053f4c47c81 100644 (file)
@@ -666,6 +666,8 @@ static void find_lines(struct mark *pm safe, struct pane *p safe,
                line_height_pre = attr_find_int(start->mdata->attrs, "line-height");
                if (line_height_pre < 1)
                        line_height_pre = 1;
+               /* We now have a better estimate than '1' */
+               line_height_post = line_height_pre;
                y_pre = start->mdata->cy + line_height_pre;
                y_post = start->mdata->h - y_pre;
        } else {