Conversation
Add a new 'foldedLine' movement unit to the `cursorMove` command that moves by model lines while treating each folded region as a single step. When moving down/up by 'wrappedLine' the cursor skips folds naturally because it operates in view space. When moving by 'line' it uses model coordinates and can land inside a fold, causing VS Code to auto-unfold it. The new 'foldedLine' unit moves in model space but queries `viewModel.getHiddenAreas()` to detect folds and jump to the first visible line past each one, so folds are skipped without being opened. This is the semantics needed by vim's j/k motions (VSCodeVim/Vim#1004): each fold counts as exactly one step, matching how real vim treats folds. Fixes: VSCodeVim/Vim#1004
Replace the step-by-step simulation (O(count × folds)) with a single pass over sorted hidden areas (O(folds in path)). Compute a naive target, then extend it for each fold encountered, stopping before any fold that reaches the document boundary. Also extracts _targetFoldedDown/_targetFoldedUp helpers to eliminate the duplicated loop structure between the two directions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot-authored message: Fix inline reference at block start rendering on its own line When an inlineReference is the first item in a chat response (no preceding markdown), it creates a standalone markdownContent with default MarkdownString properties. The subsequent markdown from the model has different properties (e.g. isTrusted: true), causing canMergeMarkdownStrings to return false. This leaves them as separate content parts, rendering the inline reference link on its own line. Fix by detecting when the previous item consists solely of synthesized content-ref links (via isContentRefOnly check) and merging them by prepending the reference text while adopting the incoming markdown's properties. Fixes #278191
* editor: add 'foldedLine' unit to cursorMove command Add a new 'foldedLine' movement unit to the `cursorMove` command that moves by model lines while treating each folded region as a single step. When moving down/up by 'wrappedLine' the cursor skips folds naturally because it operates in view space. When moving by 'line' it uses model coordinates and can land inside a fold, causing VS Code to auto-unfold it. The new 'foldedLine' unit moves in model space but queries `viewModel.getHiddenAreas()` to detect folds and jump to the first visible line past each one, so folds are skipped without being opened. This is the semantics needed by vim's j/k motions (VSCodeVim/Vim#1004): each fold counts as exactly one step, matching how real vim treats folds. Fixes: VSCodeVim/Vim#1004 * editor: simplify foldedLine movement using fold-walk algorithm Replace the step-by-step simulation (O(count × folds)) with a single pass over sorted hidden areas (O(folds in path)). Compute a naive target, then extend it for each fold encountered, stopping before any fold that reaches the document boundary. Also extracts _targetFoldedDown/_targetFoldedUp helpers to eliminate the duplicated loop structure between the two directions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * editor: fix foldedLine count movement at fold boundaries --------- Co-authored-by: Jai <jai@jai.one> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
Better handle event subscriptions (#293200)
* fix #288515: wrong current index in find widget if matches > 1000 When there are more than 1000 matches, decorations use _FIND_MATCH_NO_OVERVIEW_DECORATION instead of _FIND_MATCH_DECORATION. getCurrentMatchesPosition did not check for this decoration type, causing it to return 0 and fall through to a fallback with an off-by-one error. * Address review feedback * Fix unused error
* Fix potential listener leak in document semantic tokens Hoist provider onDidChange and registry onDidChange subscriptions from each ModelSemanticColoring instance into the singleton DocumentSemanticTokensFeature. Previously, every ModelSemanticColoring subscribed individually to both the global LanguageFeatureRegistry.onDidChange and each provider's onDidChange event, resulting in O(N*M) listeners (N models × M providers). In scenarios like chat editing where many models are created rapidly, these listeners accumulated and triggered leak detection. Now the singleton subscribes once to the registry change and once per provider (via allNoModel()), then fans out notifications to watchers. Each watcher checks provider relevance via _provider.all(model).includes() before acting on the event. Also replaces manual IDisposable[] management with a DisposableStore for proper lifecycle tracking. * Review feedback
* fix non-edit codeblocks in thinking * Address some comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )