提交 4ba03608 编写于 作者: R Rachel Macfarlane

Remove new comment glyph on mouse leave instead of blur to allow adding comments

上级 1098de4c
......@@ -243,7 +243,7 @@ export class ReviewController implements IEditorContribution {
this._commentWidgets = [];
this.localToDispose.push(this.editor.onMouseMove(e => this.onEditorMouseMove(e)));
this.localToDispose.push(this.editor.onDidBlurEditorText(() => this.onDidBlurEditorText()));
this.localToDispose.push(this.editor.onMouseLeave(() => this.onMouseLeave()));
this.localToDispose.push(this.editor.onDidChangeModelContent(() => {
if (this._newCommentGlyph) {
this.editor.removeContentWidget(this._newCommentGlyph);
......@@ -318,10 +318,6 @@ export class ReviewController implements IEditorContribution {
return;
}
if (!this.editor.hasTextFocus()) {
return;
}
const hasCommentingRanges = this._commentInfos.length && this._commentInfos.some(info => !!info.commentingRanges.length);
if (hasCommentingRanges && e.target.position && e.target.position.lineNumber !== undefined) {
if (this._newCommentGlyph && e.target.element.className !== 'comment-hint') {
......@@ -343,7 +339,7 @@ export class ReviewController implements IEditorContribution {
}
}
private onDidBlurEditorText(): void {
private onMouseLeave(): void {
if (this._newCommentGlyph) {
this.editor.removeContentWidget(this._newCommentGlyph);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册