diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-12-13 14:22:59 +0000 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-12-16 16:05:08 +0000 |
commit | 47f2769b462eb6bd1c10efec3c32ed55134ce628 (patch) | |
tree | 67194cdaa67e06e1f52288dc5abbd724db8f0286 /runtime/lua/man.lua | |
parent | b5c0290803508c0dc996a9bed70f5fa9ceb93c44 (diff) | |
download | rneovim-47f2769b462eb6bd1c10efec3c32ed55134ce628.tar.gz rneovim-47f2769b462eb6bd1c10efec3c32ed55134ce628.tar.bz2 rneovim-47f2769b462eb6bd1c10efec3c32ed55134ce628.zip |
fix(Man): completion on Mac
Problem:
`man -w` does not work on recent versions of MacOs.
Solution:
Make it so an empty result is interpreted as an error unless silent=true
Diffstat (limited to 'runtime/lua/man.lua')
-rw-r--r-- | runtime/lua/man.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index 114c94f9e5..bf2cc477fd 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -21,9 +21,12 @@ end local function system(cmd, silent, env) local r = vim.system(cmd, { env = env, timeout = 10000 }):wait() - if r.code ~= 0 and not silent then - local cmd_str = table.concat(cmd, ' ') - man_error(string.format("command error '%s': %s", cmd_str, r.stderr)) + if not silent then + if r.code ~= 0 then + local cmd_str = table.concat(cmd, ' ') + man_error(string.format("command error '%s': %s", cmd_str, r.stderr)) + end + assert(r.stdout ~= '') end return assert(r.stdout) |