feat(picker): preview window horizontal scrolling (#686)

## Description

This is an initial commit for trying to add horizontal scrolling for the
picker preview window.

Known issue: when scrolling horizontally with scope indent, the indent
chars persist in the preview window and don't disappear as they
should...

Edit:
I just realized this happens only when we are previewing a buffer that
is already open. Only in that case the indents are being rendered... if
we are previewing a file that is not currently open the indents don't
get rendered and therefore there is no issue. Maybe this is a bug?
Should we prevent rendering of the indent guides in the preview window?

## Related Issue(s)

  - Fixes #676 

## Screenshots


![image](https://github.com/user-attachments/assets/573fdba6-93cf-44f1-824d-609106996e6b)

---------

Co-authored-by: Val Gorokhovsky <valery.gorokhovsky@riverbed.com>
This commit is contained in:
acidclouds 2025-01-23 09:13:54 +01:00 committed by GitHub
parent 79a6eabd31
commit bc47e0b1dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View file

@ -479,6 +479,13 @@ function M:redraw()
end
end
---@param left? boolean
function M:hscroll(left)
vim.api.nvim_win_call(self.win, function()
vim.cmd(("normal! %s"):format(left and "zh" or "zl"))
end)
end
---@param up? boolean
function M:scroll(up)
vim.api.nvim_win_call(self.win, function()