Add startOperation and endOperation to codemirror (#29427)

https://codemirror.net/doc/manual.html#startOperation
This commit is contained in:
Joey Silva
2018-10-09 11:39:22 -07:00
committed by Andy
parent fa6c0efef5
commit de733a2952
+6
View File
@@ -364,6 +364,12 @@ declare namespace CodeMirror {
It will call the function, buffering up all changes, and only doing the expensive update after the function returns.
This can be a lot faster. The return value from this method will be the return value of your function. */
operation<T>(fn: ()=> T): T;
/** In normal circumstances, use the above operation method. But if you want to buffer operations happening asynchronously, or that can't all be wrapped in a callback
function, you can call startOperation to tell CodeMirror to start buffering changes, and endOperation to actually render all the updates. Be careful: if you use this
API and forget to call endOperation, the editor will just never update. */
startOperation(): void;
endOperation(): void;
/** Adjust the indentation of the given line.
The second argument (which defaults to "smart") may be one of: