Ticket #3372: 3372.patch
File 3372.patch, 1.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/undo/plugin.js
82 82 { 83 83 // Do not capture CTRL hotkeys. 84 84 if ( !event.data.$.ctrlKey && !event.data.$.metaKey ) 85 undoManager.type( );85 undoManager.type( event ); 86 86 }); 87 87 88 88 // Being this the first call, let's get an undo snapshot. … … 182 182 this.index = -1; 183 183 184 184 this.limit = editor.config.undoStackSize; 185 186 /** 187 * Remember last pressed key. 188 */ 189 this.lastKeystroke = 0; 185 190 } 186 191 187 192 UndoManager.prototype = 188 193 { 189 type : function() 194 /** 195 * 196 * @param {CKEDITOR.dom.event} [event] 197 */ 198 type : function( event ) 190 199 { 191 if ( !this.typing ) 200 var keystroke = event && event.data.getKeystroke(), 201 /** 202 * Backspace not preceeded by backspace. 203 */ 204 safeBackspace = keystroke == 8 && !( this.lastKeystroke == 8 ); 205 206 if ( !this.typing || safeBackspace ) 192 207 { 193 208 var beforeTypeImage = new Image( this.editor ); 194 209 … … 219 234 this.onChange(); 220 235 } 221 236 }, 222 0, this ); 237 0, this 238 ); 223 239 224 return; 240 if ( !safeBackspace ) 241 return; 225 242 } 226 243 227 244 this.typesCount++; … … 233 250 } 234 251 235 252 this.typing = true; 253 this.lastKeystroke = keystroke; 236 254 }, 237 255 238 256 fireChange : function()