Skip to content

Commit

Permalink
Allow CommentNode to change body text and enter edit mode at the same…
Browse files Browse the repository at this point in the history
… time
  • Loading branch information
joscol committed Jul 20, 2022
1 parent fbb7f41 commit ec184dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vs/workbench/contrib/comments/browser/commentNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,16 +528,18 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
this.updateCommentBody(newComment.body);
}

if (newComment.mode !== undefined && newComment.mode !== this.comment.mode) {
const isChangingMode: boolean = newComment.mode !== undefined && newComment.mode !== this.comment.mode;

this.comment = newComment;

if (isChangingMode) {
if (newComment.mode === languages.CommentMode.Editing) {
this.switchToEditMode();
} else {
this.removeCommentEditor();
}
}

this.comment = newComment;

if (newComment.label) {
this._isPendingLabel.innerText = newComment.label;
} else {
Expand Down

0 comments on commit ec184dd

Please sign in to comment.