Skip to content

Commit

Permalink
fix: don't "edit" en existing buffer. Use "buffer" instead. (#5, #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 23, 2021
1 parent 751d4de commit abef115
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/trouble/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ function View:jump(opts)
self:update()
else
View.switch_to(opts.win or self.parent)
vim.cmd("edit #" .. item.bufnr)
if vim.api.nvim_buf_get_option(item.bufnr, "buflisted") == false then
vim.cmd("edit #" .. item.bufnr)
else
vim.cmd("buffer " .. item.bufnr)
end
vim.api.nvim_win_set_cursor(self.parent,
{item.start.line + 1, item.start.character})
end
Expand Down

0 comments on commit abef115

Please sign in to comment.