Skip to content

Commit

Permalink
fix(lua_ls): plugin name detection of symlinked plugins (#140)
Browse files Browse the repository at this point in the history
Fixes #139.

When plugins on the packpath are symlinks (which is the case
when using a NixOS Neovim module), the plugin names may not be
properly detected.

This fixes that by using the symlinked path, not the real path,
to detect the plugin name.
  • Loading branch information
mrcjkb committed Mar 12, 2023
1 parent 418c544 commit a60eaee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/neodev/luals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ function M.library(opts)
local function add(lib, filter)
---@diagnostic disable-next-line: param-type-mismatch
for _, p in ipairs(vim.fn.expand(lib .. "/lua", false, true)) do
local plugin_name = vim.fn.fnamemodify(p, ":h:t")
p = vim.loop.fs_realpath(p)
if p and (not filter or filter[vim.fn.fnamemodify(p, ":h:t")]) then
if p and (not filter or filter[plugin_name]) then
if config.options.pathStrict then
table.insert(ret, p)
else
Expand Down

0 comments on commit a60eaee

Please sign in to comment.