Remove sleep; that didn't work. Add force delete Untitled buffer before deleteing all other buffers

master
Bryan 2024-10-17 07:17:59 -06:00
parent 8ef4cd0fdc
commit bf18665ad4
1 changed files with 4 additions and 4 deletions

View File

@ -88,11 +88,11 @@ local function cd_project_in_tab(dir)
end
require("persistence").save()
vim.cmd("sleep100m")
vim.fn.execute("tabe | tcd " .. vim.fn.fnameescape(dir))
vim.api.nvim_command("%bd")
vim.api.nvim_command("bdelete! Untitled")
vim.api.nvim_command("%bdelete")
require("persistence").load()
local hooks = cd_hooks.get_hooks(vim.g.cd_project_config.hooks, dir, "AFTER_CD")
@ -107,11 +107,11 @@ local function cd_project(dir)
vim.g.cd_project_current_project = dir
require("persistence").save()
vim.cmd("sleep100m")
vim.fn.execute("cd " .. vim.fn.fnameescape(dir))
vim.api.nvim_command("%bd")
vim.api.nvim_command("bdelete! Untitled")
vim.api.nvim_command("%bdelete")
require("persistence").load()
local hooks = cd_hooks.get_hooks(vim.g.cd_project_config.hooks, dir, "AFTER_CD")