From a4c4b39d55db087af19a5ed8b6a1e5ecacb0c615 Mon Sep 17 00:00:00 2001
From: James Barford-Evans <jamesbarfordevans@gmail.com>
Date: Mon, 16 Oct 2023 17:59:33 +0100
Subject: [PATCH] fix(man.lua): hardwrapped manpage is not resized #25646

Problem:
If a manpage is opened, its hardwrapped dimensions are not recalculated
after closing then revisiting the same manpage.

Solution:
Unload the manpage when it is hidden. This forces it to be reloaded,
which forces the hard-wrapping to be recalculated when it is revisited.

Fixes: #25457
---
 runtime/lua/man.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index f2bd79aca8..dcdfc2b87f 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -415,7 +415,7 @@ end
 local function set_options(pager)
   vim.bo.swapfile = false
   vim.bo.buftype = 'nofile'
-  vim.bo.bufhidden = 'hide'
+  vim.bo.bufhidden = 'unload'
   vim.bo.modified = false
   vim.bo.readonly = true
   vim.bo.modifiable = false
-- 
GitLab