From 4a4fc6ab399970a4caf6804e87fed6cd3ea2577b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 18 Aug 2023 14:19:48 +1000 Subject: [PATCH] render-lines: avoid putting extra space at EOF for small pane 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 --- DOC/TODO.md | 2 +- render-lines.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DOC/TODO.md b/DOC/TODO.md index 3dab9911..71a0b7cc 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -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. diff --git a/render-lines.c b/render-lines.c index 0ec51df3..bf136195 100644 --- a/render-lines.c +++ b/render-lines.c @@ -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 { -- 2.39.5