From 39096492aba5e2fe8a8c0bc11a040a90bb95280b Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 1 Sep 2020 22:27:50 -0400 Subject: feat/hack: Add builtin.builtin --- lua/telescope/previewers.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lua/telescope/previewers.lua') 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) -- cgit v1.2.3