description:
I have a data playback function. The scene is to play back the steps entered by the user。
But my dispatch is not processed incrementally, but uses the full amount of data in each frame。
question:
This will cause a problem that the linenumber will flash。The reason is that I added EditorView.lineWrapping
Each frame number will be replaced from the position of 0 。
useEffect(() => {
const currentValue = view ? view.state.doc.toString() : '';
if (view && value !== currentValue) {
view.dispatch({
changes: { from: 0, to: currentValue.length, insert: value || '' },
});
}
}, [value, view]);
extsion:[EditorView.lineWrapping,view.lineNumbers()]
Can the full replacement make the linenumber not flash?