feat/hack: Add builtin.builtin

This commit is contained in:
TJ DeVries
2020-09-01 22:27:50 -04:00
parent c11a661362
commit 39096492ab
4 changed files with 47 additions and 10 deletions

View File

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