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

Add event to enable UI updates + cleanup + fixes #162

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

V1OL3TF0X
Copy link
Contributor

I cleaned up timers so the spinner creates only one timer it needs, not a series every time require('package-info.ui.generic.loading-status').get() would get called
I also added an event to listen to, as some statuslines (aka feline) need to be refreshed manually, and there is no simple way to do that in the current implementation

- move timer to state
- fix index wrapping
- send event to update ui after clearing the spinner
Copy link
Owner

@vuki656 vuki656 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the PR, everything looks good.

Make sure to fix the lint to pass the pipeline

lua/package-info/ui/generic/loading-status.lua Outdated Show resolved Hide resolved
@V1OL3TF0X V1OL3TF0X requested a review from vuki656 November 3, 2024 17:48
@vuki656 vuki656 merged commit 3de4f35 into vuki656:master Nov 4, 2024
4 checks passed
@vuki656
Copy link
Owner

vuki656 commented Nov 4, 2024

Thanks for the PR!

@V1OL3TF0X
Copy link
Contributor Author

Thanks for the PR!

My pleasure. I was actually thinking about doing a 2nd one - if the package would be updated to nvim >= 0.9.5, it could use the vim.version API to mark packages that are at least X versions behind (probably specified in config) as outdated invalid too. Let me know what you thing about that

@Parsifa1
Copy link

Parsifa1 commented Dec 11, 2024

I did some research and debug and found that this PR completely prevented the spinner on my nvim-notify from rotating, but I haven't figured out what happened.

@Parsifa1
Copy link

@V1OL3TF0X have ever checked out if the nvim-notify is still working ?
honestly, i'm still trying understand you pr :)

@V1OL3TF0X
Copy link
Contributor Author

I checked briefly, but will see again. Maybe there is some versioning problem or smth

@Parsifa1
Copy link

Parsifa1 commented Dec 11, 2024

268f466

recording

3de4f35

PixPin_2024-12-12_06-28-40

this is my nvim-notify config:

return {
    "rcarriga/nvim-notify",
    lazy = true,
    init = function()
        vim.notify = function(...)
            if not require("lazy.core.config").plugins["nvim-notify"]._.loaded then
                require("lazy").load { "nvim-notify" }
            end
            require "notify"(...)
        end
    end,
    config = function()
        require("notify").setup {
            stages = "fade",
            render = "wrapped-compact",
            background_colour = "Normal",
            on_open = function(win)
                vim.api.nvim_win_set_config(win, { focusable = false })
            end,
            -- top_down = false,
        }
    end,
}

neovim version: nightly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants