Skip to content

fix: reload open buffer via checktime when server edits a file - #71

Open
tamercuba wants to merge 2 commits into
editor-code-assistant:mainfrom
tamercuba:fix/sidebar-reload-buffer-on-filechange
Open

fix: reload open buffer via checktime when server edits a file #71
tamercuba wants to merge 2 commits into
editor-code-assistant:mainfrom
tamercuba:fix/sidebar-reload-buffer-on-filechange

Conversation

@tamercuba

@tamercuba tamercuba commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Refresh open neovim buffers after ECA server file edits

Problem

When a tool call edits a file on the server side, neovim kept showing stale content for already open buffers until manual :e or :checktime

Evidences

Before

before

After

after

#70

Copilot AI lite review requested due to automatic review settings September 8, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new buffer-refresh behavior is user-visible but isn’t covered by a regression test in the existing sidebar test suite.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR addresses eca-nvim issue #70 by ensuring Neovim buffers don’t remain stale after the ECA server applies an on-disk file edit that originates from within the same Neovim session (so no FocusGained/autoread autocmd would fire).

Changes:

  • On toolCalled events with details.type == "fileChange", resolve details.path to an absolute path and call :checktime for the corresponding loaded buffer (if any).
  • Continue appending the changed file’s basename to the tool-call summary text, now derived from the absolute path.
File summaries
File Description
lua/eca/sidebar.lua Refreshes already-loaded buffers via checktime when a server-confirmed tool call reports a file change, preventing stale buffer content.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lua/eca/sidebar.lua

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is scoped, directly addresses the reported issue, and is backed by targeted automated tests covering the key behavioral cases.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@tamercuba

Copy link
Copy Markdown
Contributor Author

@joaopluigi Im aware of the eca-nvim refactor, but IMO this is a fast-to-ship and simple feature that will improve a lot the user experience of eca-nvim :)

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