Skip to content

Commit 2405570

Browse files
jay-rdcstevearc
andauthored
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>
1 parent 81b8a91 commit 2405570

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

doc/oil.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,12 @@ preview_scroll_down *actions.preview_scroll_dow
596596
preview_scroll_up *actions.preview_scroll_up*
597597
Scroll up in the preview window
598598

599+
preview_scroll_left *actions.preview_scroll_left*
600+
Scroll left in the preview window
601+
602+
preview_scroll_right *actions.preview_scroll_right*
603+
Scroll right in the preview window
604+
599605
refresh *actions.refresh*
600606
Refresh current directory list
601607

lua/oil/actions.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,30 @@ M.preview_scroll_up = {
136136
end,
137137
}
138138

139+
M.preview_scroll_left = {
140+
desc = "Scroll left in the preview window",
141+
callback = function()
142+
local winid = util.get_preview_win()
143+
if winid then
144+
vim.api.nvim_win_call(winid, function()
145+
vim.cmd.normal({ "zH", bang = true })
146+
end)
147+
end
148+
end,
149+
}
150+
151+
M.preview_scroll_right = {
152+
desc = "Scroll right in the preview window",
153+
callback = function()
154+
local winid = util.get_preview_win()
155+
if winid then
156+
vim.api.nvim_win_call(winid, function()
157+
vim.cmd.normal({ "zL", bang = true })
158+
end)
159+
end
160+
end,
161+
}
162+
139163
M.parent = {
140164
desc = "Navigate to the parent path",
141165
callback = oil.open,

0 commit comments

Comments
 (0)