Implements horizontal scrolling in previewer & results. (#2437)

* Implements horizontal scrolling in previewer & results.

* docs: update wrt. horizontal scrolling in previewer &  results
This commit is contained in:
Lucía Andrea Illanes Albornoz
2023-06-24 21:17:55 +02:00
committed by GitHub
parent ffe35cb433
commit 5fff2a138b
8 changed files with 135 additions and 0 deletions

View File

@@ -222,6 +222,18 @@ actions.preview_scrolling_down = function(prompt_bufnr)
action_set.scroll_previewer(prompt_bufnr, 1)
end
--- Scroll the preview window to the left
---@param prompt_bufnr number: The prompt bufnr
actions.preview_scrolling_left = function(prompt_bufnr)
action_set.scroll_horizontal_previewer(prompt_bufnr, -1)
end
--- Scroll the preview window to the right
---@param prompt_bufnr number: The prompt bufnr
actions.preview_scrolling_right = function(prompt_bufnr)
action_set.scroll_horizontal_previewer(prompt_bufnr, 1)
end
--- Scroll the results window up
---@param prompt_bufnr number: The prompt bufnr
actions.results_scrolling_up = function(prompt_bufnr)
@@ -234,6 +246,18 @@ actions.results_scrolling_down = function(prompt_bufnr)
action_set.scroll_results(prompt_bufnr, 1)
end
--- Scroll the results window to the left
---@param prompt_bufnr number: The prompt bufnr
actions.results_scrolling_left = function(prompt_bufnr)
action_set.scroll_horizontal_results(prompt_bufnr, -1)
end
--- Scroll the results window to the right
---@param prompt_bufnr number: The prompt bufnr
actions.results_scrolling_right = function(prompt_bufnr)
action_set.scroll_horizontal_results(prompt_bufnr, 1)
end
--- Center the cursor in the window, can be used after selecting a file to edit
--- You can just map `actions.select_default + actions.center`
---@param prompt_bufnr number: The prompt bufnr