Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: require module does not update in Lazy UI in windows #324

Closed
3 tasks done
aloknigam247 opened this issue Jan 5, 2023 · 1 comment · Fixed by #321
Closed
3 tasks done

bug: require module does not update in Lazy UI in windows #324

aloknigam247 opened this issue Jan 5, 2023 · 1 comment · Fixed by #321
Labels
bug Something isn't working

Comments

@aloknigam247
Copy link

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the exsiting issues of plugins related to this issue

Neovim version (nvim -v)

neovim-nightly

Operating system/version

Windows 11

Describe the bug

When default.lazy = true, and I require a module, its not updated in the Lazy UI as loaded in windows.

I debugged the root cause, and I could find that when my runtime paths has 'C:\Users\aloknigam\AppData\Local\nvim-data' and 'C:\Users\aloknigam\AppData\Local\nvim' both, and all my plugins are installed in 'C:\Users\aloknigam\AppData\Local\nvim-data\lazy'
So when

  -- check rtp excluding plugins. This is a very small list, so should be fast
  for _, path in ipairs(M.get_rtp()) do
    if modpath:find(path, 1, true) == 1 then
      return true
    end
  end

is executed it returns true for all the require paths and hence not updated in Lazy. code snippet from

if modpath:find(path, 1, true) == 1 then

One way to fix it add '/' to paths and compare

  -- check rtp excluding plugins. This is a very small list, so should be fast
  for _, path in ipairs(M.get_rtp()) do
    if modpath:find(path .. '/', 1, true) == 1 then
      return true
    end
  end

Steps To Reproduce

  1. set default.lazy = true in config
  2. load any unloaded module via require()
  3. check the Lazy ui its not updated as loaded

Expected Behavior

required module should be marked as loaded in Lazy UI

Repro

No response

@aloknigam247 aloknigam247 added the bug Something isn't working label Jan 5, 2023
@folke folke closed this as completed in b2dec14 Jan 5, 2023
@folke
Copy link
Owner

folke commented Jan 5, 2023

Thank you! This is probably the cause of another issue I could not reproduce that some people have. Great find!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants