diff options
Diffstat (limited to 'lua/telescope/previewers.lua')
| -rw-r--r-- | lua/telescope/previewers.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lua/telescope/previewers.lua b/lua/telescope/previewers.lua index dec99cc..48b3a1a 100644 --- a/lua/telescope/previewers.lua +++ b/lua/telescope/previewers.lua @@ -193,7 +193,7 @@ previewers.qflist = previewers.new { setup = function() local command_string = "cat %s" if vim.fn.executable("bat") then - command_string = "bat %s --highlight-line %s -r %s:%s" + command_string = "bat %s --highlight-line %s -r %s:%s" .. bat_options end return { @@ -209,9 +209,15 @@ previewers.qflist = previewers.new { local filename = entry.value.filename local lnum = entry.value.lnum - local context = math.floor(height / 2) - local start = math.max(0, lnum - context) - local finish = lnum + context + local start, finish + if entry.start and entry.finish then + start = entry.start + finish = entry.finish + else + local context = math.floor(height / 2) + start = math.max(0, lnum - context) + finish = lnum + context + end vim.api.nvim_win_set_buf(status.preview_win, bufnr) |
