]> arthur.barton.de Git - atom-ax-pipe.git/commitdiff
Don't use editor.{begin|commit}Transaction dont-use-transactions
authorAlexander Barton <alex@barton.de>
Thu, 25 Jun 2015 15:51:21 +0000 (17:51 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 25 Jun 2015 15:55:29 +0000 (17:55 +0200)
This solves the following error (but I'm not sure if not using transactions
at all is the "real" solution ...):

Uncaught TypeError: undefined is not a function

At .../Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1156

TypeError: undefined is not a function
  at TextEditor.module.exports.TextEditor.beginTransaction (.../Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1156:26)
  at .../lib/pipe.coffee:37:14
  at space-pen-div.<anonymous> (.../lib/command-view.coffee:32:7)
  at space-pen-div.jQuery.event.dispatch (.../node_modules/atom-space-pen-views/node_modules/space-pen/node_modules/jquery/dist/jquery.js:4435:9)
  at space-pen-div.elemData.handle (.../node_modules/atom-space-pen-views/node_modules/space-pen/node_modules/jquery/dist/jquery.js:4121:28)
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (.../Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (.../Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (.../Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:180:20)

lib/pipe.coffee

index 97ada8a8b67092cfa294a493be4fdc635a32694f..7c97563e4eb1e2028090ad4a35a7b6e7fa1547ad 100644 (file)
@@ -28,12 +28,10 @@ module.exports =
 
       ranges = editor.getSelectedBufferRanges()
       wg = new WaitGroup ->
-        editor.commitTransaction()
         view.focus()
 
       wg.add(ranges.length)
 
-      editor.beginTransaction()
       for range, i in ranges
         marker = editor.markBufferRange range, properties
         processRange marker, editor, commandString, wg