Skip to content

Commit 07a8164

Browse files
committed
fix: config for waiting time (decreased the default)
1 parent 55d9660 commit 07a8164

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

lib/datatip-manager.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,23 @@ module.exports = class DatatipManager {
6767
*/
6868
this.onCursorMoveEvt = this.onCursorMoveEvt.bind(this);
6969
/**
70-
* to optimize show/hide calls we set a timeout of 500ms for the mouse movement
71-
* only if the mouse pointer is not moving for more than 500ms the data tip functionality is triggered
70+
* to optimize show/hide calls we set a timeout of hoverTime for the mouse movement
71+
* only if the mouse pointer is not moving for more than hoverTime the data tip functionality is triggered
7272
*/
7373
this.mouseMoveTimer = null;
7474
/**
75-
* to optimize show/hide calls we set a timeout of 500ms for the cursor movement
76-
* only if the cursor is not moving for more than 500ms the data tip functionality is triggered
75+
* to optimize show/hide calls we set a timeout of hoverTime for the cursor movement
76+
* only if the cursor is not moving for more than hoverTime the data tip functionality is triggered
7777
*/
7878
this.cursorMoveTimer = null;
7979
/**
8080
* a reference to the markdown rendering service
8181
* @type {AtomIDE.MarkdownService}
8282
*/
8383
this.renderer = null;
84+
85+
/** 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]. */
86+
this.hoverTime = atom.config.get("atom-ide-datatip.hoverTime");
8487
}
8588

8689
/**
@@ -233,7 +236,7 @@ module.exports = class DatatipManager {
233236
(!this.currentMarkerRange.containsPoint(position))) {
234237
this.showDataTip(editor, position, evt);
235238
}
236-
}, 500, evt);
239+
}, this.hoverTime, evt);
237240
}
238241

239242
/**
@@ -272,7 +275,7 @@ module.exports = class DatatipManager {
272275
(!this.currentMarkerRange.containsPoint(point))) {
273276
this.showDataTip(this.editor, point, evt);
274277
}
275-
}, 500, evt);
278+
}, this.hoverTime, evt);
276279
}
277280

278281
/**

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
"description": "If set to true, the data tip is shown as soon as you move your mouse around.",
6666
"type": "boolean",
6767
"default": false
68+
},
69+
"hoverTime": {
70+
"title": "Hover/Stay Time",
71+
"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].",
72+
"type": "number",
73+
"default": 50
6874
}
6975
},
7076
"providedServices": {

0 commit comments

Comments
 (0)