mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-08-21 09:48:46 +02:00
fix(extras): first tabpage renaming issue
This commit is contained in:
parent
be88988cf5
commit
969874055c
1 changed files with 3 additions and 3 deletions
|
@ -25,6 +25,7 @@ return {
|
||||||
-- auto-rename tab when enter
|
-- auto-rename tab when enter
|
||||||
vim.api.nvim_create_autocmd("TabNewEntered", {
|
vim.api.nvim_create_autocmd("TabNewEntered", {
|
||||||
callback = function()
|
callback = function()
|
||||||
|
vim.notify("Tab renamed to " .. getCurrentCwdDirName())
|
||||||
-- Schedule the renaming after the tab is fully entered
|
-- Schedule the renaming after the tab is fully entered
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.cmd("BufferLineTabRename " .. getCurrentCwdDirName())
|
vim.cmd("BufferLineTabRename " .. getCurrentCwdDirName())
|
||||||
|
@ -41,10 +42,8 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- hook into persistence.nvim to rename tabs after restoring a session
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
pattern = "PersistenceLoadPost",
|
pattern = "VeryLazy",
|
||||||
once = true,
|
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
if vim.fn.exists(":BufferLineTabRename") == 2 then
|
if vim.fn.exists(":BufferLineTabRename") == 2 then
|
||||||
|
@ -53,6 +52,7 @@ return {
|
||||||
end, 1000)
|
end, 1000)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue