fxdgear / atom-python-debugger

Quick and Easy way to add Python Debugger statements
MIT License
2 stars 2 forks source link

Uncaught TypeError: editor.moveCursorDown is not a function #22

Open acrosman opened 8 years ago

acrosman commented 8 years ago

While working on a module that's part of a package in a somewhat complex application hitting F7 triggered the following error.

Atom Version: 1.0.15 System: "Fedora release Thrown From: atom-python-debugger package, v0.3.4

Stack Trace

Uncaught TypeError: editor.moveCursorDown is not a function

At /home/acrosman/.atom/packages/atom-python-debugger/lib/python-debugger.js:41

TypeError: editor.moveCursorDown is not a function
  at Object.module.exports.insert (/home/acrosman/.atom/packages/atom-python-debugger/lib/python-debugger.js:41:14)
  at atom-workspace.<anonymous> (/home/acrosman/.atom/packages/atom-python-debugger/lib/python-debugger.js:10:22)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:245:29)
  at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/usr/share/atom/resources/app.asar/src/window-event-handler.js:184:20)

Commands

  5x -5:01.5.0 core:move-up (atom-text-editor.editor.is-focused)
     -5:00.5.0 core:move-down (atom-text-editor.editor.is-focused)
  8x -5:00.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -4:56.1.0 core:save (atom-text-editor.editor.is-focused)
     -4:39.9.0 editor:newline (atom-text-editor.editor.is-focused)
 16x -4:38.5.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
     -4:25.3.0 core:save (atom-text-editor.editor.is-focused)
     -3:26 window:increase-font-size (atom-text-editor.editor.is-focused)
  3x -3:18.8.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -3:13.8.0 core:cancel (atom-text-editor.editor.is-focused)
     -3:10 core:save (atom-text-editor.editor.is-focused)
  2x -2:41 minimap:toggle (atom-text-editor.editor.is-focused)
     -2:08.9.0 timecop:view (atom-text-editor.editor.is-focused)
     -0:04.4.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:03.6.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:01.1.0 python-debugger:insert (atom-text-editor.editor.is-focused)

Config

{
  "core": {}
}

Installed Packages

# User
atom-python-debugger, v0.3.4
autocomplete-python, v0.5.3
minimap, v4.13.3
python-tools, v0.6.5

# Dev
No dev packages
ds-vsn commented 8 years ago

I also came across this issue. It appears that this tool likes to have the first line of the current file free of comments. I had a copyright statement on the first and second lines of the file, and this error was thrown. Removing the comments allows the tool to insert the import ipdb line. It actually looks like PR #21 fixes this, but it hasn't been merged/released.

SandeepNaidu commented 8 years ago

To add to ds-vsn's observation it looks like the first line should not be empty also and also not have comments for the functionality to work properly without throwing error.

davidfof13 commented 8 years ago

As SandeepNaidu just said above, the first line should not be a comment but it also shouldn't be empty so I put this statement on the first line: """Making the 1st line non-empty to make ipdb work on atom""" It no longer complained

michaelmanganiello-eb commented 8 years ago

Happens to me when first line is from __future__ import absolute_import.

ghost commented 7 years ago

I have this error too. Isn't this gonna be fixed? seems like a pretty trival issue

theSimplex commented 7 years ago

same here, have this error on most of my files.

cgarciae commented 7 years ago

+1

JonnyCBB commented 5 years ago

Any update on a fix for this?

Jogala commented 5 years ago

Issue still open... after more then 3 years...