mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2026-02-23 20:12:09 +00:00
refresh status after edit
This commit is contained in:
parent
ac9a7d501f
commit
111bbd921f
1 changed files with 7 additions and 3 deletions
|
|
@ -207,6 +207,11 @@ M._get_rc_status = function(callback)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.refresh_status = function()
|
||||||
|
cache.status = nil
|
||||||
|
M._get_rc_status(function() end)
|
||||||
|
end
|
||||||
|
|
||||||
--- Initialize direnv for current directory
|
--- Initialize direnv for current directory
|
||||||
--- @param path string Path to .envrc file
|
--- @param path string Path to .envrc file
|
||||||
M._init = function(path)
|
M._init = function(path)
|
||||||
|
|
@ -624,7 +629,7 @@ M.setup = function(user_config)
|
||||||
pattern = ".envrc",
|
pattern = ".envrc",
|
||||||
group = group_id,
|
group = group_id,
|
||||||
callback = function()
|
callback = function()
|
||||||
cache.status = nil
|
M.refresh_status()
|
||||||
notify(
|
notify(
|
||||||
".envrc file changed. Run :Direnv allow to activate changes.",
|
".envrc file changed. Run :Direnv allow to activate changes.",
|
||||||
vim.log.levels.INFO
|
vim.log.levels.INFO
|
||||||
|
|
@ -634,8 +639,7 @@ M.setup = function(user_config)
|
||||||
|
|
||||||
-- Expose a command to refresh the statusline value without triggering reload
|
-- Expose a command to refresh the statusline value without triggering reload
|
||||||
vim.api.nvim_create_user_command("DirenvStatuslineRefresh", function()
|
vim.api.nvim_create_user_command("DirenvStatuslineRefresh", function()
|
||||||
cache.last_check = 0
|
M.refresh_status()
|
||||||
M._get_rc_status(function() end)
|
|
||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
M._get_rc_status(function() end)
|
M._get_rc_status(function() end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue