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

Message on startup #40

Closed
lervag opened this issue May 29, 2022 · 6 comments · Fixed by #42
Closed

Message on startup #40

lervag opened this issue May 29, 2022 · 6 comments · Fixed by #42

Comments

@lervag
Copy link
Contributor

lervag commented May 29, 2022

Hi. I like your project and believe I will be using it. However, after a relatively recent update, gh.nvim will echo "[gh.nvim] started background refresh with interval 3 minutes" when I start neovim. It does not seem useful and at the very least, it seems out of place in this context. I suggest either of the following actions:

  • Remove this message in general.
  • Do not show message on neovim start, but rather whenever any gh.nvim related contexts is opened.
  • Any of the above with an option to control the behaviour.

Also: The background refresh is not explained in the docs and it is unclear what it is.

@ldelossa
Copy link
Owner

Its touched on here: https://who.ldelossa.is/posts/gh-nvim/#cli-dependencies

The background refresh keeps gh.nvim in sync with the GitHub api. But it wont do much if a pr is not open, or issue buffers arent open. Its required to get new comments / new PR commits / etc... automatically.

@lervag
Copy link
Contributor Author

lervag commented May 29, 2022

Ok, thanks! Still, I think the echo on neovim startup is unnecessary. Would you mind to make it optional?

@ldelossa
Copy link
Owner

Sounds find to me. Want to send a PR for this? Ill approve.

@lervag
Copy link
Contributor Author

lervag commented May 30, 2022

I'm looking into it. I'm wondering: do we really need to start the refresh timer within init.lua:

M.start_refresh_timer()

I mean, it is understandable that we want this timer when we open a PR or issue, but do we want it already when a user does the setup() function?

My intuition would be that we could just remove that line. It would resolve my issue. But perhaps I'm missing something?

@ldelossa
Copy link
Owner

ldelossa commented May 30, 2022

The timer is used to refresh arbitrary Issue buffers which can be open at any time, and unrelated to having an open PR.

Its a lot simpler to just launch the timer which runs a no-op function if no Issues or PR is open, rather then trying to ref count open Issue buffers or open PRs. The no-op timer is not going to effect UX or performance when no Issue or PR buffers are open.

@lervag
Copy link
Contributor Author

lervag commented May 30, 2022

Closing this as we can continue the discussion in #42.

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 a pull request may close this issue.

2 participants