Skip to content

Commit

Permalink
fix(ui): timeout for cursor event in editor to avoid blinking (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skraye authored Mar 28, 2023
1 parent bbcea0a commit dd18ba2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/components/inputs/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
oldDecorations: [],
editorDocumentation: undefined,
plugin: undefined,
taskType: undefined
taskType: undefined,
};
},
computed: {
Expand Down Expand Up @@ -317,7 +317,10 @@
this.editor.onDidChangeCursorPosition(e => {
let position = this.editor.getPosition();
let model = this.editor.getModel();
this.$emit("cursor",{position: position, model: model})
clearTimeout(this.lastTimeout);
this.lastTimeout = setTimeout(() => {
this.$emit("cursor",{position: position, model: model})
}, 100);
});
},
autoFold(autoFold) {
Expand Down

0 comments on commit dd18ba2

Please sign in to comment.