diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index f86f45521e0b5ec4db60736641aaa2bb3475d1fe..fdc1201e1bb3d4051407ca703b1e69acdce243e3 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -463,7 +463,7 @@ class MouseDownOperation extends Disposable { this._mouseDragThenMoveEventHandler.handler, () => { if (this._mouseState.lastMouseDownEvent !== 'drag') { - // the last event is mouse down which happens 16ms ago. + // there is no dragging so we need to update the cursor position like a simple mouse down+up. this._dispatchMouse(position, e.shiftKey); } else { this._viewController.emitMouseDrop({ diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index 4f0f21849e75cbedb3985d23ac821ef1de15903c..d36c85c3dbff0fcd21c2381d2c233d92e89edbb7 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -129,8 +129,6 @@ export class ViewController implements IViewController { } else { this.createCursor('mouse', data.position, false); } - - // last cursor range select drag } } } else { diff --git a/src/vs/editor/contrib/dnd/browser/dndHintWidget.ts b/src/vs/editor/contrib/dnd/browser/dndHintWidget.ts index f1e9b363155c78ee5aa51a0e54b096973903abf8..f005f61f9071b1d8c05a9ff059e0a622e48d0f11 100644 --- a/src/vs/editor/contrib/dnd/browser/dndHintWidget.ts +++ b/src/vs/editor/contrib/dnd/browser/dndHintWidget.ts @@ -23,7 +23,6 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte private _typicalHalfwidthCharacterWidth: number; private readonly _domNode: FastDomNode; private _isVisible: boolean = false; - private _isDirty: boolean = false; protected get isVisible(): boolean { return this._isVisible; @@ -33,27 +32,6 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte this._isVisible = value; } - protected set cursorStyle(value: TextEditorCursorStyle) { - if (this._cursorStyle !== value) { - this._cursorStyle = value; - this._isDirty = true; - } - } - - protected set lineHeight(value: number) { - if (this._lineHeight !== value) { - this._lineHeight = value; - this._isDirty = true; - } - } - - protected set typicalHalfwidthCharacterWidth(value: TextEditorCursorStyle) { - if (this._typicalHalfwidthCharacterWidth !== value) { - this._typicalHalfwidthCharacterWidth = value; - this._isDirty = true; - } - } - constructor(editor: editorBrowser.ICodeEditor) { super(); this._editor = editor; @@ -69,15 +47,15 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte this._domNode.setVisibility('hidden'); this._editor.addContentWidget(this); - this.cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle; - this.lineHeight = this._editor.getConfiguration().lineHeight; - this.typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth; + this._cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle; + this._lineHeight = this._editor.getConfiguration().lineHeight; + this._typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth; this._register(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { if (e.fontInfo || e.viewInfo || e.lineHeight) { - this.typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth; - this.lineHeight = this._editor.getConfiguration().lineHeight; - this.cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle; + this._typicalHalfwidthCharacterWidth = this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth; + this._lineHeight = this._editor.getConfiguration().lineHeight; + this._cursorStyle = this._editor.getConfiguration().viewInfo.cursorStyle; } })); @@ -136,7 +114,7 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte } private renderCursor() { - if (!this.isVisible || !this._isDirty) { + if (!this.isVisible) { return; } @@ -153,7 +131,5 @@ export class DragTargetHintWidget extends Widget implements editorBrowser.IConte } else { this._domNode.setClassName('cursor secondary'); } - - this._isDirty = false; } }