@@ -31,7 +31,8 @@ define(function (require, exports, module) {
3131 let _keyEventInterceptor = null ;
3232
3333 const CodeMirror = require ( "thirdparty/CodeMirror/lib/codemirror" ) ,
34- Menus = require ( "command/Menus" ) ;
34+ Menus = require ( "command/Menus" ) ,
35+ EditorCommandHandlers = require ( "editor/EditorCommandHandlers" ) ;
3536
3637 function _applyChanges ( changeList ) {
3738 // eslint-disable-next-line no-invalid-this
@@ -314,43 +315,57 @@ define(function (require, exports, module) {
314315 Editor . prototype . _dontDismissPopupOnScroll = _dontDismissPopupOnScroll ;
315316 }
316317
318+ /**
319+ * Sets the undo interceptor function in before it goes to codemirror
320+ * @param {Function } interceptor - Function(editor, cm, event) that returns true to preventDefault
321+ */
322+ function setUndoInterceptor ( interceptor ) {
323+ EditorCommandHandlers . _setUndoInterceptor ( interceptor ) ;
324+ }
325+
326+ /**
327+ * Sets the redo interceptor function in before it goes to codemirror
328+ * @param {Function } interceptor - Function(editor, cm, event) that returns true to preventDefault
329+ */
330+ function setRedoInterceptor ( interceptor ) {
331+ EditorCommandHandlers . _setRedoInterceptor ( interceptor ) ;
332+ }
333+
317334 /**
318335 * Sets the cut interceptor function in codemirror
319- * @param {Function } interceptor - Function(editor, cm, event) that returns true to
320- preventDefault
336+ * @param {Function } interceptor - Function(editor, cm, event) that returns true to preventDefault
321337 */
322338 function setCutInterceptor ( interceptor ) {
323339 _cutInterceptor = interceptor ;
324340 }
325341
326342 /**
327343 * Sets the copy interceptor function in codemirror
328- * @param {Function } interceptor - Function(editor, cm, event) that returns true to
329- preventDefault
344+ * @param {Function } interceptor - Function(editor, cm, event) that returns true to preventDefault
330345 */
331346 function setCopyInterceptor ( interceptor ) {
332347 _copyInterceptor = interceptor ;
333348 }
334349
335350 /**
336351 * Sets the paste interceptor function in codemirror
337- * @param {Function } interceptor - Function(editor, cm, event) that returns true to
338- preventDefault
352+ * @param {Function } interceptor - Function(editor, cm, event) that returns true to preventDefault
339353 */
340354 function setPasteInterceptor ( interceptor ) {
341355 _pasteInterceptor = interceptor ;
342356 }
343357
344358 /**
345359 * Sets the key down/up/press interceptor function in codemirror
346- * @param {Function } interceptor - Function(editor, cm, event) that returns true to
347- preventDefault
360+ * @param {Function } interceptor - Function(editor, cm, event) that returns true to preventDefault
348361 */
349362 function setKeyEventInterceptor ( interceptor ) {
350363 _keyEventInterceptor = interceptor ;
351364 }
352365
353366 exports . addHelpers = addHelpers ;
367+ exports . setUndoInterceptor = setUndoInterceptor ;
368+ exports . setRedoInterceptor = setRedoInterceptor ;
354369 exports . setCutInterceptor = setCutInterceptor ;
355370 exports . setCopyInterceptor = setCopyInterceptor ;
356371 exports . setPasteInterceptor = setPasteInterceptor ;
0 commit comments