提交 48179d7b 编写于 作者: R Rachel Macfarlane

Fix updates to comment glyph position

上级 c8e55761
......@@ -33,6 +33,10 @@ export class CommentGlyphWidget implements IContentWidget {
return this._id;
}
setLineNumber(lineNumber: number): void {
this._lineNumber = lineNumber;
}
getPosition(): IContentWidgetPosition {
return {
position: {
......
......@@ -296,7 +296,12 @@ export class ReviewZoneWidget extends ZoneWidget {
this._localToDispose.push(this.editor.onMouseDown(e => this.onEditorMouseDown(e)));
this._localToDispose.push(this.editor.onMouseUp(e => this.onEditorMouseUp(e)));
this._localToDispose.push(this.editor.onDidChangeModelContent(() => {
if (this._commentGlyph.getPosition().position.lineNumber !== this.position.lineNumber) {
this._commentGlyph.setLineNumber(this.position.lineNumber);
this.editor.layoutContentWidget(this._commentGlyph);
}
}));
var headHeight = Math.ceil(this.editor.getConfiguration().lineHeight * 1.2);
this._headElement.style.height = `${headHeight}px`;
this._headElement.style.lineHeight = this._headElement.style.height;
......
......@@ -182,6 +182,12 @@ export class ReviewController implements IEditorContribution {
this._commentWidgets = [];
this.localToDispose.push(this.editor.onMouseMove(e => this.onEditorMouseMove(e)));
this.localToDispose.push(this.editor.onDidChangeModelContent(() => {
if (this._newCommentGlyph) {
this.editor.removeContentWidget(this._newCommentGlyph);
this._newCommentGlyph = null;
}
}));
this.localToDispose.push(this.commentService.onDidUpdateCommentThreads(e => {
const editorURI = this.editor && this.editor.getModel() && this.editor.getModel().uri;
if (!editorURI) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册