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: empty plugin folder if network connection aborted the installation. #224

Closed
3 tasks done
towry opened this issue Dec 29, 2022 · 5 comments · Fixed by #197
Closed
3 tasks done

bug: empty plugin folder if network connection aborted the installation. #224

towry opened this issue Dec 29, 2022 · 5 comments · Fixed by #197
Labels
bug Something isn't working

Comments

@towry
Copy link

towry commented Dec 29, 2022

Did you check docs and existing issues?

  • I have read all the lazy docs
  • I have searched the existing issues of lazy
  • I have searched the exsiting issues of the plugin I have a problem with

Neovim version (nvim -v)

NVIM v0.9.0-dev-503+ga442c9f55-dirty

Operating system/version

macOS 13.0.1 22A400 x86_64

Describe the bug

I am in China, the network connection to github is not very good, so sometimes the the installation may fail.

Steps:

  1. :Lazy
  2. The Lazy installation begins.
  3. Installation failed due to network connection issue.
  4. No response, can not quit by using cmdline with :q!.
  5. quit with tmux panel close command.
  6. reopen neovim, open lazy, the plugin status is installed and up to date.

But the module can not be found, and the plugin folder is almost empty with only .git folder. git status shows all files is deleted.

What I have tried without manually deleting the empty plugin folder:

  1. Run Lazy sync. (all success)
  2. Run lazy update (all success)

截屏2022-12-29 09 24 11

The plugin status in lazy:
截屏2022-12-29 09 18 17

Steps To Reproduce

  1. See the above description.

Expected Behavior

I think the network connection issue is not avoidable, so this issue should be taken care by the Lazy (maybe) ?

Repro

Nothing special.

https://github.com/pze/econvim
@towry towry added the bug Something isn't working label Dec 29, 2022
@towry
Copy link
Author

towry commented Dec 29, 2022

Successfully install the plugin again after manually deleted the plugin folder.

But error message shown from the plugin that I need to call setup before using the plugin ( no such issue on my home macbook)

截屏2022-12-29 09 34 59

The lazy spec file: https://github.com/pze/econvim/blob/master/lua/towry/plugins/hlslens.lua

@folke
Copy link
Owner

folke commented Dec 29, 2022

If your error drops after the main .git files were downloaded, then there's no way for lazy to know that something didn't work properly. In the lazy ui, you can go to the offending plugin and press x to delete and i or just sync to re-install.
That hllens error is unrelated to lazy. Just make sure you call setup in config as suggested

@folke folke closed this as completed Dec 29, 2022
@towry
Copy link
Author

towry commented Dec 29, 2022

截屏2022-12-29 15 32 25

local M = {
  'kevinhwang91/nvim-hlslens',
}

function M.config()
  require('hlslens').setup({
    auto_enable = true,
    enable_incsearch = true,
    calm_down = true,
    nearest_only = false,
  })
  vim.notify("hlslens setup called")
end

function M.init()
  local kopts = { noremap = false, silent = true }

  vim.api.nvim_set_keymap('n', 'n',
    [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
  vim.api.nvim_set_keymap('n', 'N',
    [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
    kopts)
  vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
  vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
  vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
  vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)
end

return M

@folke folke reopened this Dec 29, 2022
@folke folke closed this as completed in 044e28b Dec 29, 2022
@folke
Copy link
Owner

folke commented Dec 29, 2022

This was indeed a lazy issue. Fixed!

@towry
Copy link
Author

towry commented Dec 29, 2022

Thanks!

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