From 08db61b19b8fa07131fdcbea306893539963d4cb Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Wed, 21 Jun 2023 14:42:23 -0500 Subject: [PATCH] feat(man): respect 'wrapmargin' when wrapping man pages (#24091) --- runtime/doc/news.txt | 2 ++ runtime/lua/man.lua | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 }