mirror of
https://github.com/kiteco/vscode-plugin.git
synced 2024-09-11 16:08:10 +03:00
more clear code
This commit is contained in:
parent
b1944a8bad
commit
f9b95016ee
@ -10,6 +10,7 @@ import {
|
||||
TextEditor,
|
||||
TextEditorDecorationType,
|
||||
TextEditorSelectionChangeEvent,
|
||||
TextEditorSelectionChangeKind,
|
||||
ThemeColor,
|
||||
window,
|
||||
workspace
|
||||
@ -59,10 +60,13 @@ export default class KiteRelatedCodeDecorationsProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof(event.kind) !== 'undefined' && event.kind !== 1 && typeof(this.editTimeout) === 'undefined') {
|
||||
if (typeof(this.editTimeout) === 'undefined' && (event.kind === TextEditorSelectionChangeKind.Command || event.kind === TextEditorSelectionChangeKind.Mouse)) {
|
||||
// If timeout is not set (i.e. the decoration is already showing), and the cursor is moved by
|
||||
// a non-edit event, then show the decoration immediately.
|
||||
this.decorate(event);
|
||||
|
||||
} else {
|
||||
// Otherwise, show the decoration after 1 second of inactivity.
|
||||
this.clearDecorations(event.textEditor);
|
||||
|
||||
if (typeof(this.editTimeout) !== 'undefined') {
|
||||
|
Loading…
Reference in New Issue
Block a user