Skip to content

Commit

Permalink
Merge branch 'nvim-telescope:master' into plenary-path2
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestrew authored Sep 6, 2024
2 parents 7469b0c + 5972437 commit 4d90fc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lua/telescope/previewers/buffer_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ previewers.new_buffer_previewer = function(opts)
function opts.setup(self)
local state = {}
if opt_setup then
vim.tbl_deep_extend("force", state, opt_setup(self))
state = vim.tbl_deep_extend("force", state, opt_setup(self))
end
return state
end
Expand Down
15 changes: 6 additions & 9 deletions lua/telescope/previewers/term_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ local bat_maker = function(filename, lnum, start, finish)
local command = { "bat" }

if lnum then
table.insert(command, { "--highlight-line", lnum })
vim.list_extend(command, { "--highlight-line", lnum })
end

if has_less then
if start then
table.insert(command, { "--pager", string.format("less -RS +%s", start) })
vim.list_extend(command, { "--pager", string.format("less -RS +%s", start) })
else
table.insert(command, { "--pager", "less -RS" })
vim.list_extend(command, { "--pager", "less -RS" })
end
else
if start and finish then
table.insert(command, { "-r", string.format("%s:%s", start, finish) })
vim.list_extend(command, { "-r", string.format("%s:%s", start, finish) })
end
end

Expand Down Expand Up @@ -102,9 +102,6 @@ local get_maker = function(opts)
return maker
end

-- TODO: We shoudl make sure that all our terminals close all the way.
-- Otherwise it could be bad if they're just sitting around, waiting to be closed.
-- I don't think that's the problem, but it could be?
previewers.new_termopen_previewer = function(opts)
opts = opts or {}

Expand Down Expand Up @@ -161,7 +158,7 @@ previewers.new_termopen_previewer = function(opts)
function opts.setup(self)
local state = {}
if opt_setup then
vim.tbl_deep_extend("force", state, opt_setup(self))
state = vim.tbl_deep_extend("force", state, opt_setup(self))
end
return state
end
Expand Down Expand Up @@ -192,7 +189,7 @@ previewers.new_termopen_previewer = function(opts)

local prev_bufnr = get_bufnr_by_bufentry(self, entry)
if prev_bufnr then
self.state.termopen_bufnr = prev_bufnr
set_bufnr(self, prev_bufnr)
utils.win_set_buf_noautocmd(preview_winid, self.state.termopen_bufnr)
self.state.termopen_id = term_ids[self.state.termopen_bufnr]
else
Expand Down

0 comments on commit 4d90fc1

Please sign in to comment.