Skip to content

Commit 54f96da

Browse files
fix: Replace window instead of split if no file buffers available (#150)
closes #145
1 parent 56ea140 commit 54f96da

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

lua/fff/picker_ui.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,12 +1278,7 @@ function M.select(action)
12781278
-- If current active buffer is not a normal buffer we find a suitable window with a tab otherwise opening a new split
12791279
if current_buftype ~= '' or not current_buf_modifiable then
12801280
local suitable_win = find_suitable_window()
1281-
if suitable_win then
1282-
vim.api.nvim_set_current_win(suitable_win)
1283-
else
1284-
vim.cmd('split ' .. vim.fn.fnameescape(relative_path))
1285-
return
1286-
end
1281+
if suitable_win then vim.api.nvim_set_current_win(suitable_win) end
12871282
end
12881283

12891284
vim.cmd('edit ' .. vim.fn.fnameescape(relative_path))

0 commit comments

Comments
 (0)