Skip to content

fix: Watcher not updating on file change - #342

Draft
ALameLlama wants to merge 2 commits into
FylerOrg:mainfrom
ALameLlama:fix/watcher-not-always-updating
Draft

fix: Watcher not updating on file change#342
ALameLlama wants to merge 2 commits into
FylerOrg:mainfrom
ALameLlama:fix/watcher-not-always-updating

Conversation

@ALameLlama

Copy link
Copy Markdown
Contributor

Currently the watcher doesn't always update the git status without reopening fyler, I mostly noticed this when editing files or adding new files.

Before:
Screencast_20260704_133548.webm

After:
Screencast_20260704_133913.webm

@A7Lavinraj

Copy link
Copy Markdown
Collaborator

Replace final schedule call with following:

vim.schedule(function()
  if not watch_state[buf_id] then return end
  if vim.bo[buf_id].modified then return end

  local pending = state.pending_refresh
  state.pending_refresh = nil

  pcall(function() instance:refresh(pending) end)
end)

Because I want it return before setting pending refresh to nil.

@ALameLlama

Copy link
Copy Markdown
Contributor Author

Sounds good, I'll update this on the weekend and test it out

@ALameLlama
ALameLlama force-pushed the fix/watcher-not-always-updating branch from d1a23f4 to 331a437 Compare July 12, 2026 09:21
@ALameLlama
ALameLlama force-pushed the fix/watcher-not-always-updating branch from 331a437 to c503c43 Compare July 12, 2026 09:30
@ALameLlama

Copy link
Copy Markdown
Contributor Author

Can you hold off on merging this? I've noticed I'm getting a weird flashing only on hidden files. I'll need to look into what is causing this

@ALameLlama
ALameLlama marked this pull request as draft July 12, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants