satellite.nvim icon indicating copy to clipboard operation
satellite.nvim copied to clipboard

Expose enable / disable Lua interface

Open spywhere opened this issue 2 years ago • 4 comments

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 avatar Jun 20 '22 03:06 spywhere

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.

lewis6991 avatar Jun 20 '22 13:06 lewis6991

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

spywhere avatar Jun 20 '22 14:06 spywhere

It looks like what you actually want is:

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

lewis6991 avatar Jun 20 '22 14:06 lewis6991

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.).

spywhere avatar Jun 20 '22 14:06 spywhere