Skip to content

Commit 487e0fb

Browse files
authored
Merge pull request #124 from atom-community/fix-mouse-move
2 parents f230f6b + 92fb28d commit 487e0fb

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

lib/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"title": "Hover/Stay Time",
1616
"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].",
1717
"type": "number",
18-
"default": 80
18+
"default": 100
1919
},
2020
"glowOnHover": {
2121
"title": "Glow on hover",

lib/datatip-manager.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -487,24 +487,26 @@ export class DataTipManager {
487487
})
488488
disposables.add(new Disposable(() => overlayMarker.destroy()))
489489

490-
element.addEventListener("mouseenter", () => {
491-
this.editorView?.removeEventListener("mousemove", this.onMouseMoveEvt)
492-
})
490+
if (this.showDataTipOnMouseMove) {
491+
element.addEventListener("mouseenter", () => {
492+
this.editorView?.removeEventListener("mousemove", this.onMouseMoveEvt)
493+
})
493494

494-
element.addEventListener("mouseleave", () => {
495-
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
496-
})
495+
element.addEventListener("mouseleave", () => {
496+
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
497+
})
498+
499+
disposables.add(
500+
new Disposable(() => {
501+
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
502+
view.destroy()
503+
})
504+
)
505+
}
497506

498507
// TODO move this code to atom-ide-base
499508
element.addEventListener("wheel", this.onMouseWheel, { passive: true })
500509

501-
disposables.add(
502-
new Disposable(() => {
503-
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
504-
view.destroy()
505-
})
506-
)
507-
508510
return disposables
509511
}
510512

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"test.integration": "npm run build && atom --test spec",
2121
"clean": "shx rm -rf dist",
2222
"tsc": "tsc -p ./lib/tsconfig.json",
23+
"tsc.dev": "npm run tsc -- --watch",
2324
"dev": "npm run clean && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=true rollup -c -w",
2425
"build": "npm run clean && cross-env NODE_ENV=production cross-env BABEL_KEEP_MODULES=true rollup -c",
2526
"build-commit": "build-commit -o dist",

0 commit comments

Comments
 (0)