pimentel / atom-r-exec

Send R code to various R consoles from the Atom editor
https://atom.io/packages/r-exec
MIT License
19 stars 8 forks source link

Uncaught TypeError: Cannot read property 'substring' of undefined #18

Closed smartlu closed 8 years ago

smartlu commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.4 System: Mac OS X 10.10.5 Thrown From: r-exec package, v0.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'substring' of undefined

At /Users/xiangxiangzeng/.atom/packages/r-exec/lib/r-exec.coffee:79

TypeError: Cannot read property 'substring' of undefined
    at Object.module.exports.setWorkingDirectory (/Users/xiangxiangzeng/.atom/packages/r-exec/lib/r-exec.coffee:79:14)
    at atom-workspace.<anonymous> (/Users/xiangxiangzeng/.atom/packages/r-exec/lib/r-exec.coffee:31:27)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:987:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)

Commands

     -2:59.7.0 core:select-up (atom-text-editor.editor.is-focused)
     -2:57.9.0 editor:newline-below (atom-text-editor.editor.is-focused)
     -2:56.9.0 core:move-down (atom-text-editor.editor.is-focused)
     -2:55.4.0 core:select-up (atom-text-editor.editor.is-focused)
     -2:54.9.0 editor:newline-below (atom-text-editor.editor.is-focused)
  7x -2:54.1.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -2:50.7.0 core:select-down (atom-text-editor.editor.is-focused)
     -2:47.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -2:41.9.0 tree-view:add-folder (span.name.icon.icon-file-directory)
     -2:40.8.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -2:40.3.0 tool-panel:unfocus (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
  2x -1:47.6.0 core:cancel (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
     -1:07.6.0 r-exec:send-command (ul.list-inline.tab-bar.inset-panel)
     -1:03.5.0 core:select-up (atom-text-editor.editor.is-focused)
     -1:01.8.0 editor:newline-below (atom-text-editor.editor.is-focused)
     -0:00.4.0 r-exec:setwd (atom-text-editor.editor.is-focused)

Config

{
  "core": {}
}

Installed Packages

# User
language-r, v0.4.0
r-exec, v0.3.0

# Dev
No dev packages
pimentel commented 8 years ago

Did the file you were trying to setwd have a filename associated with it?

smartlu commented 8 years ago

You are right. I am so new to this ATOM. Using R or R studio all the time. Let me follow your suggestion and see if I can figure out.

Appreciate for you writing me back.

TL

On Mon, Dec 7, 2015 at 1:31 PM, Harold Pimentel notifications@github.com wrote:

Did the file you were trying to setwd have a filename associated with it?

— Reply to this email directly or view it on GitHub https://github.com/hafen/atom-r-exec/issues/18#issuecomment-162669841.

pimentel commented 8 years ago

FYI, the latest version (currently at the pull request status) now gives you an error if the file doesn't exist yet

pimentel commented 8 years ago

This is now fixed in the latest version in the Atom package manager.