aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-06-21 14:42:23 -0500
committerGitHub <noreply@github.com>2023-06-21 14:42:23 -0500
commit08db61b19b8fa07131fdcbea306893539963d4cb (patch)
tree5f706dec84178277054e037ed07b4664fa214a9d
parente27377e33e029a9c2efb282d4c4e51effd76dd88 (diff)
downloadrneovim-08db61b19b8fa07131fdcbea306893539963d4cb.tar.gz
rneovim-08db61b19b8fa07131fdcbea306893539963d4cb.tar.bz2
rneovim-08db61b19b8fa07131fdcbea306893539963d4cb.zip
feat(man): respect 'wrapmargin' when wrapping man pages (#24091)
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/lua/man.lua2
2 files changed, 3 insertions, 1 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 550b69010d..292b0da1af 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -134,6 +134,8 @@ The following changes to existing APIs or features add new behavior.
• |:checkhealth| buffer now implements |folding|. The initial folding status is
defined by the 'foldenable' option.
+• |:Man| now respects 'wrapmargin'
+
==============================================================================
REMOVED FEATURES *news-removed*
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index 08aff20a03..f2bd79aca8 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -436,7 +436,7 @@ local function get_page(path, silent)
elseif vim.env.MANWIDTH then
manwidth = vim.env.MANWIDTH
else
- manwidth = api.nvim_win_get_width(0)
+ manwidth = api.nvim_win_get_width(0) - vim.o.wrapmargin
end
local cmd = localfile_arg and { 'man', '-l', path } or { 'man', path }