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

@@ -26,6 +26,7 @@ function Previewer:new(opts)
_teardown_func = opts.teardown,
_send_input = opts.send_input,
_scroll_fn = opts.scroll_fn,
_scroll_horizontal_fn = opts.scroll_horizontal_fn,
preview_fn = opts.preview_fn,
_empty_bufnr = nil,
}, Previewer)
@@ -95,4 +96,12 @@ function Previewer:scroll_fn(direction)
end
end
function Previewer:scroll_horizontal_fn(direction)
if self._scroll_horizontal_fn then
self:_scroll_horizontal_fn(direction)
else
vim.api.nvim_err_writeln "scroll_horizontal_fn is not defined for this previewer"
end
end
return Previewer