mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
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  --------- Co-authored-by: Val Gorokhovsky <valery.gorokhovsky@riverbed.com>
This commit is contained in:
parent
79a6eabd31
commit
bc47e0b1dd
3 changed files with 19 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue