aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/man.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/man.lua')
-rw-r--r--runtime/lua/man.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index 348e502f34..b9213c8259 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -479,7 +479,13 @@ local function put_page(page)
-- XXX: nroff justifies text by filling it with whitespace. That interacts
-- badly with our use of $MANWIDTH=999. Hack around this by using a fixed
-- size for those whitespace regions.
- vim.cmd([[silent! keeppatterns keepjumps %s/\s\{199,}/\=repeat(' ', 10)/g]])
+ -- Use try/catch to avoid setting v:errmsg.
+ vim.cmd([[
+ try
+ keeppatterns keepjumps %s/\s\{199,}/\=repeat(' ', 10)/g
+ catch
+ endtry
+ ]])
vim.cmd('1') -- Move cursor to first line
highlight_man_page()
set_options()