Skip to content

Conversation

@ultronozm
Copy link
Contributor

Fixes #430.

  • copilot.el (track-changes): New requirement. (copilot--lsp-pos): New helper function.
    (copilot--generate-doc): Use it.
    (copilot--on-doc-change): Remove.
    (copilot--track-changes-id): New buffer-local variable. (copilot--lsp-range-end-from-oldtext): New helper function. (copilot--track-changes-signal): New function to fetch and forward buffer changes.
    (copilot--mode-setup): Remove old before-change-functions and after-change-functions hooks, register with track-changes instead. (copilot--mode-teardown): Remove old cleanup code, unregister from track-changes.

* copilot.el (track-changes): New requirement.
(copilot--lsp-pos): New helper function.
(copilot--generate-doc): Use it.
(copilot--on-doc-change): Remove.
(copilot--track-changes-id): New buffer-local variable.
(copilot--lsp-range-end-from-oldtext): New helper function.
(copilot--track-changes-signal): New function to fetch and forward
buffer changes.
(copilot--mode-setup): Remove old before-change-functions and
after-change-functions hooks, register with track-changes instead.
(copilot--mode-teardown): Remove old cleanup code, unregister from
track-changes.

* Eask: Add track-changes version 1.4 as a dependency.
Copy link
Collaborator

@bbatsov bbatsov left a comment

Choose a reason for hiding this comment

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

Nice improvement! I hadn't noticed the track-changes library so far, but it looks quite handy.

@bbatsov bbatsov merged commit 60ded1b into copilot-emacs:main Oct 28, 2025
13 checks passed
@ultronozm ultronozm deleted the track-changes branch October 28, 2025 13:30
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.

Synchronization issue with complex edits

2 participants