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

Expose enable / disable Lua interface #12

Open
spywhere opened this issue Jun 20, 2022 · 4 comments
Open

Expose enable / disable Lua interface #12

spywhere opened this issue Jun 20, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@spywhere
Copy link

spywhere commented Jun 20, 2022

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Expose enable and disable to the Lua interface for better Lua integration

Describe alternatives you've considered
I could use a function to call vim.cmd('SatelliteEnable') (or disable), but those Lua interface would be nice

Additional context
Mind that if it get implemented, both calls could be run before setup. So a call guard might be needed to prevent unexpected behavior.

@spywhere spywhere added the enhancement New feature or request label Jun 20, 2022
@lewis6991
Copy link
Owner

Do you have valid use cases to why you want an API for this? Asking for things without any justification other than "it would be nice" doesn't really fly.

@spywhere
Copy link
Author

spywhere commented Jun 20, 2022

Asking for things without any justification other than "it would be nice" doesn't really fly

Fair point. My use case was to plug the enable/disable function into my callback directly without a need to use vim.cmd.

Here's the code in my dotfiles that would be benefit by using a lua interface: https://github.com/spywhere/dotfiles/blob/de33a0b0a700b01a57b406db92dc3be57a057a8b/configs/nvim/lua/plugin/appearance/satellite.lua#L40

@lewis6991
Copy link
Owner

It looks like what you actually want is:

require('satellite').setup {
  current_only = true,
}

@spywhere
Copy link
Author

spywhere commented Jun 20, 2022

No, that piece of code was to show the scrollbar for a certain amount of time before hiding it, then show it again once I moved the cursor or scroll the window (or etc.).

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

No branches or pull requests

2 participants