Skip to content

Updating the edit context on content change not on lines inserted, deleted and changed - #298272

Merged
Aiday Marlen Kyzy (aiday-mar) merged 2 commits into
mainfrom
ugly-ant
Feb 28, 2026
Merged

Aiday Marlen Kyzy (aiday-mar) merged 2 commits into
mainfrom
ugly-ant

Conversation

@aiday-mar

Copy link
Copy Markdown
Collaborator

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.

Pull request overview

This PR fixes an issue with NativeEditContext updates by switching from view-layer events to model-layer events for detecting content changes. The change improves reliability by listening directly to model content changes rather than relying on view events that may not fire in all scenarios.

Changes:

  • Added onDidChangeContent model event handler to detect content changes and update EditContext when changes overlap with the current selection
  • Removed the _updateEditContextOnLineChange helper method that was called from view event handlers
  • Simplified onLinesChanged, onLinesDeleted, and onLinesInserted view event handlers to just return true (still needed for rendering)

@aiday-mar
Aiday Marlen Kyzy (aiday-mar) merged commit a6967f7 into main Feb 28, 2026
20 checks passed
Don Jayamanne (DonJayamanne) pushed a commit that referenced this pull request Mar 2, 2026
…leted and changed (#298272)

* updating the edit context on content change not on lines inserted, deleted and changed

* saving the previous edit context text
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants