feat: add horizontal scrolling actions (#709)

* feat: add horizontal scrolling actions

* refactor(actions): remove unnecessary use of `nvim_replace_termcodes`

* lint: apply stylua

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
This commit is contained in:
Ross 2026-01-12 05:53:17 +08:00 committed by GitHub
parent 81b8a91735
commit 24055701b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View file

@ -596,6 +596,12 @@ preview_scroll_down *actions.preview_scroll_dow
preview_scroll_up *actions.preview_scroll_up*
Scroll up in the preview window
preview_scroll_left *actions.preview_scroll_left*
Scroll left in the preview window
preview_scroll_right *actions.preview_scroll_right*
Scroll right in the preview window
refresh *actions.refresh*
Refresh current directory list

View file

@ -136,6 +136,30 @@ M.preview_scroll_up = {
end,
}
M.preview_scroll_left = {
desc = "Scroll left in the preview window",
callback = function()
local winid = util.get_preview_win()
if winid then
vim.api.nvim_win_call(winid, function()
vim.cmd.normal({ "zH", bang = true })
end)
end
end,
}
M.preview_scroll_right = {
desc = "Scroll right in the preview window",
callback = function()
local winid = util.get_preview_win()
if winid then
vim.api.nvim_win_call(winid, function()
vim.cmd.normal({ "zL", bang = true })
end)
end
end,
}
M.parent = {
desc = "Navigate to the parent path",
callback = oil.open,