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] Spinner "not included" #147

Open
3 tasks done
pavkam opened this issue Dec 30, 2023 · 2 comments
Open
3 tasks done

[BUG] Spinner "not included" #147

pavkam opened this issue Dec 30, 2023 · 2 comments
Labels
🐛 Bug Something isn't working

Comments

@pavkam
Copy link

pavkam commented Dec 30, 2023

Issues

  • I have checked existing issues and there are no issues with the same problem.

Plugin Version

  • I am using the latest version of the plugin

Neovim Version

  • I am using the 0.6 neovim version or later

Neovim Version

NVIM v0.9.4

Branch

master

Actual behavior

using require('package-info').get_status() returns the status string in the form of | Doing something. But the spinner char is not prepended.

Expected behavior

Expecting that the spinner char is prepended before the message.

Steps to reproduce

Just call the require('package-info').get_status().

Package info config

  • not relevant

Other information

Looking in lua/package-info/ui/generic/loading-status.lua I don't see any usage of the current_spinner except when it's updated.

I am using lualine and I have added this section to allow the status to be reflected:

{
    function()
        local pi_status = require 'package-info.ui.generic.loading-status'

        vim.defer_fn(function()
            utils.trigger_status_update_event() -- Force update of lualine (helper method in my config)
        end, 100)

        return pi_status.state.current_spinner .. ' ' .. pi_status.get() -- See here that I am prepending the char myself
    end,
    cond = function()
        return require('package-info').get_status() ~= ''
    end,
    color = color 'ShellProgressStatus',
}

Help

No, sorry.

Implementation help

No response

@pavkam pavkam added the 🐛 Bug Something isn't working label Dec 30, 2023
@vuki656
Copy link
Owner

vuki656 commented Jan 11, 2024

Yeah it used to be included but I removed it since it was buggy and wasn't working properly.

If you can open a PR with a valid solution i'd be happy to accept it. I remember seeing some other plugins that had a progress spinner but forget which ones. Maybe the implementation can be borrowed.

@pavkam
Copy link
Author

pavkam commented Jan 12, 2024

Actually, I have changed my implementation a bit since I do have a "progress" module in my config which I use extensively with other processes and I've used that instead (to have the same spinner look and feel). Maybe it's worth only to expose a callback to people to tap into and add their own custom code.

If I get some time this weekend I might try to make a PR as well.

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

No branches or pull requests

2 participants