diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-09-01 22:27:50 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-09-01 22:27:50 -0400 |
| commit | 39096492aba5e2fe8a8c0bc11a040a90bb95280b (patch) | |
| tree | 0bd503bbf045d6057c40b9c6484873cfc785eea4 /lua/telescope/previewers.lua | |
| parent | c11a6613625008c7d45702301cdf404873674c58 (diff) | |
feat/hack: Add builtin.builtin
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) |
