Closed BoostDmitry closed 4 years ago
@BoostDmitry I am a lot shorter on time these days as when I started this project. Codemirror & React APIs are moving to quickly for me to keep atop of for the day-to-day. I am looking for a co-maintainer of this project. Please contact me directly if you are interested. Thank you for understanding.
I am interested as a co-maintainer.
@sukrut-gs - happy to help see this through if you have a PR or any ideas here? Offhand I wonder if this might help based on the description https://github.com/scniro/react-codemirror2/pull/146
fyi I have the same issue where I'm using the Controlled
component and undo doesn't "work"
I have a suspicion that what's missing is the performance of an "operation" in codemirror speak, ala
cm.operation(function () {
cm.replaceRange(out, from, to);
});
yup, just tested this - in your paste handler if instead of calling setValue
or whatnot you instead compute the values for cm.replaceRange
and call that it works as intended (and automatically calls onBeforeChange
for you thereby hitting your setValue
call
Updating the code in the editor by updating the variable the code is stored in clears the editor history (no ctrl+z :cry: ). https://codesandbox.io/s/interesting-sky-6nvrv?fontsize=14&hidenavigation=1&theme=dark