atom / autosave

Autosaves buffers when they lose focus
MIT License
63 stars 29 forks source link

Error raised on tab close #12

Closed abe33 closed 10 years ago

abe33 commented 10 years ago

Started with v0.101.0, whenever I close a tab, the autosave package raise an exception. The autosave option is disabled.

Uncaught TypeError: Object #<PaneView> has no method 'getModel' autosave.coffee:9
(anonymous function) autosave.coffee:9
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360
jQuery.event.trigger /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4594
jQuery.event.simulate /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4893
handler /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:5009
jQuery.fn.extend.remove /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:5501
module.exports.EditorView.remove editor-view.coffee:805
module.exports.PaneView.onItemRemoved pane-view.coffee:170
(anonymous function) pane-view.coffee:1
(anonymous function) /Users/cedric/github/atom/node_modules/emissary/lib/emitter.js:133
module.exports.Emitter.emit /Users/cedric/github/atom/node_modules/emissary/lib/emitter.js:132
module.exports.Pane.removeItem pane.coffee:173
module.exports.Pane.destroyItem pane.coffee:200
module.exports.Pane.destroyActiveItem pane.coffee:191
module.exports.Workspace.destroyActivePaneItem workspace.coffee:268
_results.push._this.(anonymous function) /Users/cedric/github/atom/node_modules/delegato/lib/delegator.js:67
(anonymous function) workspace-view.coffee:157
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360
module.exports.KeymapManager.dispatchCommandEvent /Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js:395
module.exports.KeymapManager.handleKeyboardEvent /Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js:176
(anonymous function) window-event-handler.coffee:61
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360

It does not prevent the tab from being closed but just pop the console out.

kevinsawicki commented 10 years ago

/cc @nathansobo

It looks like this space pen behavior recently changed, is this something you think could still be an issue?

It is really easy to just guard the call to getModel but it seems odds that event.targetView() would return a PaneView when the focusout handler is registered on .editor:not(.mini) elements.

nathansobo commented 10 years ago

I hadn't merged the SpacePen change to master so I'm not sure. I saw the brief upgrade then downgrade and investigated the issue. I wonder of merging in the getModel shim would deal with it. I'm still traveling home and on a cellphone but I can try to look into it on the next flight.

nathansobo commented 10 years ago

Sorry, I see now that it's resolving the target view to the pane. This does seem like a potential symptom of the change I made to SpacePen. Looking into it.

kevinsawicki commented 10 years ago

@nathansobo this is fixed now right?

nathansobo commented 10 years ago

Yep.