This commit is contained in:
TJ DeVries
2020-10-08 22:53:44 -04:00
parent 3cf3acc4d5
commit 2ce3ad61aa
2 changed files with 5 additions and 12 deletions

View File

@@ -97,13 +97,8 @@ local function goto_file_selection(prompt_bufnr, command)
filename = path.normalize(filename, vim.fn.getcwd()) filename = path.normalize(filename, vim.fn.getcwd())
-- TODO: Sometimes we open something with missing line numbers and stuff...
if entry_bufnr then if entry_bufnr then
if command == "edit" then vim.cmd(string.format(":%s #%d", command, entry_bufnr))
a.nvim_win_set_buf(original_win_id, entry_bufnr)
else
vim.cmd(string.format(":%s #%d", command, entry_bufnr))
end
else else
local bufnr = vim.api.nvim_get_current_buf() local bufnr = vim.api.nvim_get_current_buf()
if filename ~= vim.api.nvim_buf_get_name(bufnr) then if filename ~= vim.api.nvim_buf_get_name(bufnr) then
@@ -119,10 +114,6 @@ local function goto_file_selection(prompt_bufnr, command)
end end
end end
end end
if command == "edit" then
vim.api.nvim_command("doautocmd filetypedetect BufRead " .. vim.fn.fnameescape(filename))
end
end end
end end

View File

@@ -238,9 +238,11 @@ function StaticFinder:new(opts)
local results = {} local results = {}
for k, v in ipairs(input_results) do for k, v in ipairs(input_results) do
local entry = entry_maker(v) local entry = entry_maker(v)
entry.index = k
table.insert(results, entry) if entry then
entry.index = k
table.insert(results, entry)
end
end end
return setmetatable({ results = results }, self) return setmetatable({ results = results }, self)