georgebrindeiro / scroll-sync

Atom editor package: Synchronize scrolling of two editor panes by content.
MIT License
29 stars 8 forks source link

Uncaught TypeError: Cannot read property 'item' of undefined #15

Closed stemd closed 8 years ago

stemd commented 8 years ago

Atom 1.5.4 (again) cause race error.

Steps to reproduce error: Press Ctrl + Alt + S after splitting window in two panes. After minute or two (or after first error) it does not happen again, pressing Ctrl + Alt + S results in ScrlSync visible in StatusBar, but desired (and expected) functionality is missing, when scrolling only one pane (active pane) is scrolling, so package is broken on Atom 1.5.4., or more precisely - needs to adapt to recent changes in Atom.

Environment: Atom Version: 1.5.4 System: Ubuntu 15.04

Thrown From: scroll-sync package, v0.1.4

Stack Trace

Uncaught TypeError: Cannot read property 'item' of undefined

At /home/user/.atom/packages/scroll-sync/lib/scroll-sync.coffee:34

TypeError: Cannot read property 'item' of undefined
    at ScrlSync.startTracking (/home/user/.atom/packages/scroll-sync/lib/scroll-sync.coffee:34:19)
    at atom-workspace.subToggle.add.atom.commands.add.scroll-sync:toggle (/home/user/.atom/packages/scroll-sync/lib/scroll-sync.coffee:19:30)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/atom/resources/app.asar/src/command-registry.js:260:29)
    at /opt/atom/resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:570:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:378:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/opt/atom/resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/opt/atom/resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:08.7.0 tabs:split-right (li.tab.sortable.active.right-clicked)
     -0:00.7.0 scroll-sync:toggle (atom-text-editor.editor.is-focused)

Installed Packages

# User
remote-edit, v1.8.24
scroll-sync, v0.1.4

# Dev
No dev packages
lazlojuly commented 8 years ago

@mark-hahn did you manage to push the latest version (which should fix at least the first part of this reported issue) to Atom Packages?

mark-hahn commented 8 years ago

Apparently I forgot. Sorry. It is now 0.1.5.