From 62f767c798f02358dc08b2c58db47287a515c100 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Sat, 4 Jul 2026 01:04:12 +1000 Subject: [PATCH 1/3] fix: Watcher not updating on file change --- lua/fyler/extensions/watcher.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/fyler/extensions/watcher.lua b/lua/fyler/extensions/watcher.lua index 0ffe6fd..a2009c2 100644 --- a/lua/fyler/extensions/watcher.lua +++ b/lua/fyler/extensions/watcher.lua @@ -17,7 +17,7 @@ function H.start_handle(buf_id, dir_path, on_event) local handle = uv.new_fs_event() if not handle then return end - local ok = handle:start(dir_path, { watch_entry = true }, function(err, filename, status) + local ok = handle:start(dir_path, {}, function(err, filename, status) if err then return end on_event(filename, status) end) @@ -113,7 +113,7 @@ extensions.register({ local is_git_dir = dir_path:match('/%.git$') H.start_handle(buf_id, dir_path, function(filename, status) if is_git_dir and filename and not (filename == 'index') then return end - if not is_git_dir and not (status and status.rename) then return end + if not is_git_dir and not (status and (status.rename or status.change)) then return end if is_git_dir then state.pending_refresh = { force = true, recursive = true } From 33756e666c74bf649bae469da0e0f72428c77194 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Sat, 4 Jul 2026 13:32:39 +1000 Subject: [PATCH 2/3] fix: Watcher not updating on new files --- lua/fyler/extensions/git.lua | 2 ++ lua/fyler/extensions/watcher.lua | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/fyler/extensions/git.lua b/lua/fyler/extensions/git.lua index 14f89ce..da274f2 100644 --- a/lua/fyler/extensions/git.lua +++ b/lua/fyler/extensions/git.lua @@ -21,6 +21,8 @@ local default_icons = { [' M'] = { icon = '*', hl = 'FylerGitModified' }, ['M '] = { icon = '+', hl = 'FylerGitStaged' }, ['MM'] = { icon = '+', hl = 'FylerGitStaged' }, + ['A '] = { icon = '+', hl = 'FylerGitStaged' }, + ['AM'] = { icon = '+', hl = 'FylerGitStaged' }, ['??'] = { icon = '?', hl = 'FylerGitUntracked' }, [' D'] = { icon = '-', hl = 'FylerGitDeleted' }, ['D '] = { icon = '-', hl = 'FylerGitStaged' }, diff --git a/lua/fyler/extensions/watcher.lua b/lua/fyler/extensions/watcher.lua index a2009c2..9836ad7 100644 --- a/lua/fyler/extensions/watcher.lua +++ b/lua/fyler/extensions/watcher.lua @@ -112,7 +112,7 @@ extensions.register({ if not state.handles[dir_path] then local is_git_dir = dir_path:match('/%.git$') H.start_handle(buf_id, dir_path, function(filename, status) - if is_git_dir and filename and not (filename == 'index') then return end + if is_git_dir and filename and not (filename == 'index' or filename == 'index.lock') then return end if not is_git_dir and not (status and (status.rename or status.change)) then return end if is_git_dir then @@ -126,7 +126,11 @@ extensions.register({ state.timer:start(cfg.debounce_ms, 0, function() 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) end) From b124c1d728b5821b2ef5c576643469720b695262 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Fri, 7 Aug 2026 16:34:13 +1000 Subject: [PATCH 3/3] feat: Watcher flashing git icons as is scans the files 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 --- lua/fyler/extensions/git.lua | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lua/fyler/extensions/git.lua b/lua/fyler/extensions/git.lua index da274f2..07ac8e8 100644 --- a/lua/fyler/extensions/git.lua +++ b/lua/fyler/extensions/git.lua @@ -195,12 +195,13 @@ extensions.register({ config.extensions.git = vim.tbl_deep_extend('force', { icons = vim.deepcopy(default_icons), inline = true }, opts) end, hooks = { - finder_refresh_post = function(inst, visible, hl_ns, lines, args) + finder_refresh_post = function(inst, visible, _, lines, args) local cfg = require('fyler.config').DATA.extensions.git if not cfg.enabled then return end refresh_count = refresh_count + 1 local current_count = refresh_count + local git_ns = vim.api.nvim_create_namespace('FylerGitBuf' .. inst.buf_id) local gc = H.git_col(lines) local function apply(i, item, stat) @@ -211,7 +212,7 @@ extensions.register({ pcall( vim.api.nvim_buf_set_extmark, inst.buf_id, - hl_ns, + git_ns, i - 1, item._name_col + #item.name, { virt_text = { { icon, hl } }, hl_mode = 'combine' } @@ -220,7 +221,7 @@ extensions.register({ pcall( vim.api.nvim_buf_set_extmark, inst.buf_id, - hl_ns, + git_ns, i - 1, 0, { virt_text = { { icon, hl } }, virt_text_win_col = gc, hl_mode = 'combine' } @@ -230,20 +231,29 @@ extensions.register({ pcall( vim.api.nvim_buf_set_extmark, inst.buf_id, - hl_ns, + git_ns, i - 1, item._name_col, { hl_group = hl, end_line = i - 1, end_col = item._name_col + #item.name, hl_mode = 'combine' } ) end + + local function render(statuses) + pcall(vim.api.nvim_buf_clear_namespace, inst.buf_id, git_ns, 0, -1) + for i, item in ipairs(visible) do + local stat = statuses[item.path] + if stat then apply(i, item, stat) end + end + end + + render(inst.cache.git_statuses or {}) + H.statuses_async(visible, args and args.force, function(statuses) if current_count == refresh_count then H.propagate_to_parents(statuses) H.store_known_roots() - for i, item in ipairs(visible) do - local stat = statuses[item.path] - if stat then apply(i, item, stat) end - end + inst.cache.git_statuses = statuses + render(statuses) end end) end,