diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 838692ae3..117ce168c 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -458,9 +458,8 @@ TextEditorComponent = React.createClass selectedLength = inputNode.selectionEnd - inputNode.selectionStart editor.selectLeft() if selectedLength is 1 - insertedRange = editor.transact(-> + insertedRange = editor.transact @constructor.groupingInterval, -> editor.insertText(event.data) - , @constructor.groupingInterval) inputNode.value = event.data if insertedRange onVerticalScroll: (scrollTop) -> diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index fca421232..ad2e63043 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -141,9 +141,8 @@ editorEventListeners = (commandListeners) -> newCommandListeners[commandName] = (event) -> event.stopPropagation() model = @getModel() - model.transact(-> + model.transact TextEditorComponent.groupingInterval, -> commandListener.call(model, event) - , TextEditorComponent.groupingInterval) newCommandListeners atom.commands.add 'atom-text-editor', editorEventListeners( diff --git a/src/text-editor.coffee b/src/text-editor.coffee index c1f0b9f56..6e8ab4922 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -1096,10 +1096,10 @@ class TextEditor extends Model # abort the transaction, call {::abortTransaction} to terminate the function's # execution and revert any changes performed up to the abortion. # + # * `groupingInterval` (optional) This is the sames as the `groupingInterval` + # parameter in {::beginTransaction} # * `fn` A {Function} to call inside the transaction. - # * `groupingInterval` This is the sames as the `groupingInterval` parameter - # in {::beginTransaction} - transact: (fn, groupingInterval) -> @buffer.transact(fn, groupingInterval) + transact: (groupingInterval, fn) -> @buffer.transact(groupingInterval, fn) # Extended: Start an open-ended transaction. #