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
This commit is contained in:
haorenW1025
2020-09-17 00:20:45 +08:00
committed by GitHub
parent 9bdf5b3d4a
commit 7d1a8292b6
4 changed files with 52 additions and 1 deletions

View File

@@ -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)