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

@@ -2532,6 +2532,22 @@ actions.preview_scrolling_down({prompt_bufnr}) *telescope.actions.preview_scroll
{prompt_bufnr} (number) The prompt bufnr
actions.preview_scrolling_left({prompt_bufnr}) *telescope.actions.preview_scrolling_left()*
Scroll the preview window to the left
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.preview_scrolling_right({prompt_bufnr}) *telescope.actions.preview_scrolling_right()*
Scroll the preview window to the right
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.results_scrolling_up({prompt_bufnr}) *telescope.actions.results_scrolling_up()*
Scroll the results window up
@@ -2548,6 +2564,22 @@ actions.results_scrolling_down({prompt_bufnr}) *telescope.actions.results_scroll
{prompt_bufnr} (number) The prompt bufnr
actions.results_scrolling_left({prompt_bufnr}) *telescope.actions.results_scrolling_left()*
Scroll the results window to the left
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.results_scrolling_right({prompt_bufnr}) *telescope.actions.results_scrolling_right()*
Scroll the results window to the right
Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
actions.center({prompt_bufnr}) *telescope.actions.center()*
Center the cursor in the window, can be used after selecting a file to edit
You can just map `actions.select_default + actions.center`
@@ -3407,6 +3439,7 @@ previewers.Previewer() *telescope.previewers.Previewer()*
- `:teardown()`
- `:send_input(input)`
- `:scroll_fn(direction)`
- `:scroll_horizontal_fn(direction)`
`Previewer:new()` expects a table as input with following keys:
- `setup` function(self): Will be called the first time preview will be
@@ -3422,6 +3455,8 @@ previewers.Previewer() *telescope.previewers.Previewer()*
`termopen_previewer` and it can be used to send input to the terminal
application, like less.
- `scroll_fn` function(self, direction): Used to make scrolling work.
- `scroll_horizontal_fn` function(self, direction): Used to make
horizontal scrolling work.