@@ -37,18 +37,18 @@ local bat_maker = function(filename, lnum, start, finish)
37
37
local command = { " bat" }
38
38
39
39
if lnum then
40
- table.insert (command , { " --highlight-line" , lnum })
40
+ vim . list_extend (command , { " --highlight-line" , lnum })
41
41
end
42
42
43
43
if has_less then
44
44
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 ) })
46
46
else
47
- table.insert (command , { " --pager" , " less -RS" })
47
+ vim . list_extend (command , { " --pager" , " less -RS" })
48
48
end
49
49
else
50
50
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 ) })
52
52
end
53
53
end
54
54
@@ -102,9 +102,6 @@ local get_maker = function(opts)
102
102
return maker
103
103
end
104
104
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?
108
105
previewers .new_termopen_previewer = function (opts )
109
106
opts = opts or {}
110
107
@@ -161,7 +158,7 @@ previewers.new_termopen_previewer = function(opts)
161
158
function opts .setup (self )
162
159
local state = {}
163
160
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 ))
165
162
end
166
163
return state
167
164
end
@@ -192,7 +189,7 @@ previewers.new_termopen_previewer = function(opts)
192
189
193
190
local prev_bufnr = get_bufnr_by_bufentry (self , entry )
194
191
if prev_bufnr then
195
- self . state . termopen_bufnr = prev_bufnr
192
+ set_bufnr ( self , prev_bufnr )
196
193
utils .win_set_buf_noautocmd (preview_winid , self .state .termopen_bufnr )
197
194
self .state .termopen_id = term_ids [self .state .termopen_bufnr ]
198
195
else
0 commit comments