Skip to content

Commit

Permalink
fix: trigger initial update when lazy loading
Browse files Browse the repository at this point in the history
  • Loading branch information
MunifTanjim committed May 3, 2023
1 parent 5a529df commit 16fa360
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/crates/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function M.setup(cfg)

local group = vim.api.nvim_create_augroup("Crates", {})
if state.cfg.autoload then
if vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t") == "Cargo.toml" then
M.update()
end

vim.api.nvim_create_autocmd("BufRead", {
group = group,
pattern = "Cargo.toml",
Expand Down
4 changes: 4 additions & 0 deletions teal/crates/init.tl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function M.setup(cfg: Config)

local group = vim.api.nvim_create_augroup("Crates", {})
if state.cfg.autoload then
if vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t") == "Cargo.toml" then
M.update()
end

vim.api.nvim_create_autocmd("BufRead", {
group = group,
pattern = "Cargo.toml",
Expand Down

0 comments on commit 16fa360

Please sign in to comment.