Skip to content

fix: Watcher not updating on file change - #342

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

fix: Watcher not updating on file change#342
ALameLlama wants to merge 3 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 2 times, most recently 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
@ALameLlama
ALameLlama force-pushed the fix/watcher-not-always-updating branch from 1df77e3 to abb5087 Compare August 7, 2026 06:40
@ALameLlama

Copy link
Copy Markdown
Contributor Author
[nix-shell:~/personal/fyler.nvim]$ make
Results:
0 errors
0 warnings
0 parse errors
Total number of cases: 317
Total number of groups: 4

tests/integrations/finder.test.lua: ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
tests/unit/lib_fs.test.lua: ooo
tests/unit/lib_path.test.lua: oooooooooooooooooooo
tests/unit/setup.test.lua: ooo

Fails (0) and Notes (0)
Help file "doc/fyler.txt" is successfully generated.
README.md has been generated successfully
wiki.md has been generated successfully

I think the CI is just failing again due to performance?

@ALameLlama
ALameLlama marked this pull request as ready for review August 7, 2026 06:43
@ALameLlama

Copy link
Copy Markdown
Contributor Author

Sorry for the delay on this but the issue seemed to be since both shared a namespace it would updated and clear it causing a flashing issue, adding cache and a separate namespace.

if you have a better way to handle this I'm all ears :)

@A7Lavinraj

Copy link
Copy Markdown
Collaborator

Sure tell you when I got free

@ALameLlama

Copy link
Copy Markdown
Contributor Author

take your time, I'll keep playing around with it and update you if I notice anything else weird

Since this was sharing a namespace with the highligh namespace, updates
to that would clear the git icons until the git watch was done causing a
flashing effect. added separate namespace and cache so they don't flash
@ALameLlama
ALameLlama force-pushed the fix/watcher-not-always-updating branch from abb5087 to d862f89 Compare August 8, 2026 07:04
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