From 290f82240f429ae4284aa385f0e40c59ef25a07a Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 30 Mar 2024 14:38:39 +0100 Subject: pager: exclude status line from buffer height --- src/local/container.nim | 4 ++++ src/local/pager.nim | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/local/container.nim b/src/local/container.nim index 2acd7d8a..3772b0b0 100644 --- a/src/local/container.nim +++ b/src/local/container.nim @@ -1550,6 +1550,10 @@ proc windowChange*(container: Container; attrs: WindowAttributes) = container.width = attrs.width container.height = attrs.height - 1 if container.iface != nil: + var attrs = attrs + # subtract status line height + attrs.height -= 1 + attrs.height_px -= attrs.ppl container.iface.windowChange(attrs).then(proc() = container.needslines = true ) diff --git a/src/local/pager.nim b/src/local/pager.nim index 25042f5f..0d1088d2 100644 --- a/src/local/pager.nim +++ b/src/local/pager.nim @@ -1600,11 +1600,15 @@ proc connected(pager: Pager; container: Container; response: Response) = else: container.flags.excl(cfIsHTML) # buffer now actually exists; create a process for it + var attrs = pager.attrs + # subtract status line height + attrs.height -= 1 + attrs.height_px -= attrs.ppl container.process = pager.forkserver.forkBuffer( container.config, container.url, container.request, - pager.attrs, + attrs, mailcapRes.ishtml, container.charsetStack ) -- cgit 1.4.1-2-gfad0