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

feature: Picker preview horizontal scrolling #676

Open
1 task done
acidclouds opened this issue Jan 20, 2025 · 0 comments · May be fixed by #686
Open
1 task done

feature: Picker preview horizontal scrolling #676

acidclouds opened this issue Jan 20, 2025 · 0 comments · May be fixed by #686
Labels
enhancement New feature or request

Comments

@acidclouds
Copy link

acidclouds commented Jan 20, 2025

Did you check the docs?

  • I have read all the snacks.nvim docs

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

I am using a vertical layout on my display and I would like to scroll the preview window horizontally as sometimes the line doesn't fit completely in the preview window.

Describe the solution you'd like

I would like the ability to configure a keymap to scroll the preview window horizontally

Describe alternatives you've considered

I considered publishing a PR, similar to the way the preview window is scrolled right now.
I understand we need to add it to win.lua like this:

function M:scroll(up)

and add an action here:

https://github.com/folke/snacks.nvim/blob/main/lua/snacks/picker/actions.lua#L296

However, what is worrying me is this line here:

https://github.com/folke/snacks.nvim/blob/main/lua/snacks/win.lua#L144

because in order to scroll we need to do zl however we send one keycode here... I'm not sure we can send two and what happens if someone remaps the zl keymap?

also, I'm not sure what the sidescrolloff option means and if it related...

Thanks a lot!

Additional context

Love your work!!

@acidclouds acidclouds added the enhancement New feature or request label Jan 20, 2025
@acidclouds acidclouds linked a pull request Jan 21, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant