Fix: check for Untitled existing

master
Bryan 2024-10-17 07:26:12 -06:00
parent 0436ae9135
commit abd7fb8bd4
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ local function cd_project_in_tab(dir)
vim.fn.execute("tabe | tcd " .. vim.fn.fnameescape(dir))
if vim.fn.bufnr("Untitled") == -1 then
if vim.fn.bufnr("Untitled") ~= -1 then
vim.api.nvim_command("bdelete! Untitled")
end
vim.api.nvim_command("%bdelete")
@ -112,7 +112,7 @@ local function cd_project(dir)
vim.fn.execute("cd " .. vim.fn.fnameescape(dir))
if vim.fn.bufnr("Untitled") == -1 then
if vim.fn.bufnr("Untitled") ~= -1 then
vim.api.nvim_command("bdelete! Untitled")
end
vim.api.nvim_command("%bdelete")