Skip to content

Commit fd7c13b

Browse files
authored
fix: Code editor malfunction (#4523)
1 parent 38191f7 commit fd7c13b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ui/src/components/codemirror-editor/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ function getRangeFromLineAndColumn(state: any, line: number, column: number, end
9797
}
9898
}
9999
const asyncLint = throttle(async (view: any) => {
100+
const sendString = view.state.doc.toString()
100101
const res = await loadSharedApi({ type: 'tool', systemType: apiType.value }).postPylint(
101102
view.state.doc.toString(),
102103
)
104+
if (sendString !== view.state.doc.toString()) {
105+
return []
106+
}
103107
return res.data
104108
}, 500)
105109

0 commit comments

Comments
 (0)