diff options
| author | haorenW1025 <whz861025@gmail.com> | 2020-09-17 00:20:45 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-16 12:20:45 -0400 |
| commit | 7d1a8292b6c7db7401af05f75e6d9992fc8ed28a (patch) | |
| tree | d0d3a0c34b5ad8e70583c2a1c8c67d87abda89a5 /lua/telescope/actions.lua | |
| parent | 9bdf5b3d4af99b76d3cd25466af708d57d6a1483 (diff) | |
feat: add scrolling in preview window (#47)
* feat: add scrolling in preview window
refactor into two layers
* remove redundant code
* add error message for scroll_fn and send_input
* consider count for preview scrolling
Diffstat (limited to 'lua/telescope/actions.lua')
| -rw-r--r-- | lua/telescope/actions.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/telescope/actions.lua b/lua/telescope/actions.lua index 50c9fe2..224a3e4 100644 --- a/lua/telescope/actions.lua +++ b/lua/telescope/actions.lua @@ -34,6 +34,14 @@ function actions.get_selected_entry(prompt_bufnr) return actions.get_current_picker(prompt_bufnr):get_selection() end +function actions.preview_scrolling_up(prompt_bufnr) + actions.get_current_picker(prompt_bufnr).previewer:scroll_fn(-30) +end + +function actions.preview_scrolling_down(prompt_bufnr) + actions.get_current_picker(prompt_bufnr).previewer:scroll_fn(30) +end + -- TODO: It seems sometimes we get bad styling. local function goto_file_selection(prompt_bufnr, command) local picker = actions.get_current_picker(prompt_bufnr) |
