diff --git a/lib/config.json b/lib/config.json index 9c2d343..985947b 100644 --- a/lib/config.json +++ b/lib/config.json @@ -15,7 +15,7 @@ "title": "Hover/Stay Time", "description": "The time that the mouse/cursor should hover/stay to show a datatip. Also specifies the time that the datatip is still shown when the mouse/cursor moves [ms].", "type": "number", - "default": 80 + "default": 100 }, "glowOnHover": { "title": "Glow on hover", diff --git a/lib/datatip-manager.ts b/lib/datatip-manager.ts index 59b3dfc..950eb49 100644 --- a/lib/datatip-manager.ts +++ b/lib/datatip-manager.ts @@ -487,24 +487,26 @@ export class DataTipManager { }) disposables.add(new Disposable(() => overlayMarker.destroy())) - element.addEventListener("mouseenter", () => { - this.editorView?.removeEventListener("mousemove", this.onMouseMoveEvt) - }) + if (this.showDataTipOnMouseMove) { + element.addEventListener("mouseenter", () => { + this.editorView?.removeEventListener("mousemove", this.onMouseMoveEvt) + }) - element.addEventListener("mouseleave", () => { - this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt) - }) + element.addEventListener("mouseleave", () => { + this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt) + }) + + disposables.add( + new Disposable(() => { + this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt) + view.destroy() + }) + ) + } // TODO move this code to atom-ide-base element.addEventListener("wheel", this.onMouseWheel, { passive: true }) - disposables.add( - new Disposable(() => { - this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt) - view.destroy() - }) - ) - return disposables } diff --git a/package.json b/package.json index 164fdc0..e6adc4d 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "test.integration": "npm run build && atom --test spec", "clean": "shx rm -rf dist", "tsc": "tsc -p ./lib/tsconfig.json", + "tsc.dev": "npm run tsc -- --watch", "dev": "npm run clean && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=true rollup -c -w", "build": "npm run clean && cross-env NODE_ENV=production cross-env BABEL_KEEP_MODULES=true rollup -c", "build-commit": "build-commit -o dist",