Skip to content

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

Open
aiday-mar wants to merge 2 commits intomainfrom
ugly-ant
Open

Updating the edit context on content change not on lines inserted, deleted and changed#298272
aiday-mar wants to merge 2 commits intomainfrom
ugly-ant

Conversation

@aiday-mar
Copy link
Contributor

Copilot AI review requested due to automatic review settings February 27, 2026 15:06
@aiday-mar aiday-mar self-assigned this Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

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-mar requested a review from alexdima February 27, 2026 15:14
@aiday-mar aiday-mar marked this pull request as ready for review February 27, 2026 15:14
@aiday-mar aiday-mar enabled auto-merge (squash) February 27, 2026 15:14
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