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, 8 insertions, 0 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index 18d08ad1a8..6eebee6376 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -283,6 +283,14 @@ local function get_path(sect, name, silent)
return
end
+ -- `man -w /some/path` will return `/some/path` for any existent file, which
+ -- stops us from actually determining if a path has a corresponding man file.
+ -- Since `:Man /some/path/to/man/file` isn't supported anyway, we should just
+ -- error out here if we detect this is the case.
+ if sect == '' and #results == 1 and results[1] == name then
+ return
+ end
+
-- find any that match the specified name
local namematches = vim.tbl_filter(function(v)
return fn.fnamemodify(v, ':t'):match(name)