Skip to content

Commit

Permalink
fix: improve detection of open threads
Browse files Browse the repository at this point in the history
Fixes issue where submitted a thread would open an extra window, instead
of updating
  • Loading branch information
Willem Jan Noort committed Jul 10, 2024
1 parent d936d07 commit 457c6d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/adopure/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ end
---@param new_bufname string
---@return number bufnr
local function new_or_convert_window(new_bufname)
if vim.api.nvim_buf_get_name(0):find("%[adopure %- new %-") then
local bufparts = vim.split(vim.api.nvim_buf_get_name(0), "/")
local bufname = bufparts[#bufparts]
if bufname:find("%[adopure %- new %-") or bufname == new_bufname then
return convert_ado_window(new_bufname)
end
return open_new_split(new_bufname)
Expand Down

0 comments on commit 457c6d7

Please sign in to comment.