Skip to content

Commit

Permalink
fix: only open new tab if tab option is set
Browse files Browse the repository at this point in the history
fixes #66
  • Loading branch information
willothy committed Aug 25, 2023
1 parent 41272ef commit 9f08ac1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/flatten/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ M.edit_files = function(opts)
buf = file.bufnr,
})
else
---@diagnostic disable-next-line: redundant-parameter
vim.api.nvim_buf_set_option(file.bufnr, "buflisted", true)
end

Expand All @@ -168,7 +169,9 @@ M.edit_files = function(opts)
}
end

---@type window
local winnr
---@type buffer
local bufnr

local is_diff = vim.tbl_contains(argv, "-d")
Expand Down Expand Up @@ -234,7 +237,7 @@ M.edit_files = function(opts)
vim.cmd.split()
elseif open == "vsplit" then
vim.cmd.vsplit()
else
elseif open == "tab" then
vim.cmd.tabnew()
end
vim.api.nvim_set_current_buf(focus.bufnr)
Expand Down

0 comments on commit 9f08ac1

Please sign in to comment.