Skip to content

Commit 4d90fc1

Browse files
authored
Merge branch 'nvim-telescope:master' into plenary-path2
2 parents 7469b0c + 5972437 commit 4d90fc1

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

lua/telescope/previewers/buffer_previewer.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ previewers.new_buffer_previewer = function(opts)
380380
function opts.setup(self)
381381
local state = {}
382382
if opt_setup then
383-
vim.tbl_deep_extend("force", state, opt_setup(self))
383+
state = vim.tbl_deep_extend("force", state, opt_setup(self))
384384
end
385385
return state
386386
end

lua/telescope/previewers/term_previewer.lua

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ local bat_maker = function(filename, lnum, start, finish)
3737
local command = { "bat" }
3838

3939
if lnum then
40-
table.insert(command, { "--highlight-line", lnum })
40+
vim.list_extend(command, { "--highlight-line", lnum })
4141
end
4242

4343
if has_less then
4444
if start then
45-
table.insert(command, { "--pager", string.format("less -RS +%s", start) })
45+
vim.list_extend(command, { "--pager", string.format("less -RS +%s", start) })
4646
else
47-
table.insert(command, { "--pager", "less -RS" })
47+
vim.list_extend(command, { "--pager", "less -RS" })
4848
end
4949
else
5050
if start and finish then
51-
table.insert(command, { "-r", string.format("%s:%s", start, finish) })
51+
vim.list_extend(command, { "-r", string.format("%s:%s", start, finish) })
5252
end
5353
end
5454

@@ -102,9 +102,6 @@ local get_maker = function(opts)
102102
return maker
103103
end
104104

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

@@ -161,7 +158,7 @@ previewers.new_termopen_previewer = function(opts)
161158
function opts.setup(self)
162159
local state = {}
163160
if opt_setup then
164-
vim.tbl_deep_extend("force", state, opt_setup(self))
161+
state = vim.tbl_deep_extend("force", state, opt_setup(self))
165162
end
166163
return state
167164
end
@@ -192,7 +189,7 @@ previewers.new_termopen_previewer = function(opts)
192189

193190
local prev_bufnr = get_bufnr_by_bufentry(self, entry)
194191
if prev_bufnr then
195-
self.state.termopen_bufnr = prev_bufnr
192+
set_bufnr(self, prev_bufnr)
196193
utils.win_set_buf_noautocmd(preview_winid, self.state.termopen_bufnr)
197194
self.state.termopen_id = term_ids[self.state.termopen_bufnr]
198195
else

0 commit comments

Comments
 (0)