Skip to content

Commit 64e4666

Browse files
authored
CommentController.activeCommentThread not updated when navigating from editor gutter (microsoft#223840)
Fixes microsoft#223824
1 parent cdb4d0d commit 64e4666

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,11 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
319319
this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed;
320320
}
321321

322-
public expand() {
322+
public expand(setActive?: boolean) {
323323
this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded;
324+
if (setActive) {
325+
this.commentService.setActiveCommentAndThread(this.uniqueOwner, { thread: this._commentThread });
326+
}
324327
}
325328

326329
public getGlyphPosition(): number {

src/vs/workbench/contrib/comments/browser/commentsController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ export class CommentController implements IEditorContribution {
10981098
const existingCommentsAtLine = this._commentWidgets.filter(widget => widget.getGlyphPosition() === (commentRange ? commentRange.endLineNumber : 0));
10991099
if (existingCommentsAtLine.length) {
11001100
const allExpanded = existingCommentsAtLine.every(widget => widget.expanded);
1101-
existingCommentsAtLine.forEach(allExpanded ? widget => widget.collapse() : widget => widget.expand());
1101+
existingCommentsAtLine.forEach(allExpanded ? widget => widget.collapse() : widget => widget.expand(true));
11021102
this.processNextThreadToAdd();
11031103
return;
11041104
} else {

0 commit comments

Comments
 (0)