Skip to content

Uncaught TypeError: Cannot read property 'replace' of undefined #5

@jimklo

Description

@jimklo

[Enter steps to reproduce below:]

  1. Installed plugin
  2. Restarted Atom
  3. Opened existing RST file with table that needed formatting cleanup
  4. Pressed TAB key.
  5. Exception thrown

Here's the RST table that throws the error:

+------------------------+----------------------------------------------------------------------------+
| Sub Project            | Artifact Path                                                              |
+========================+============================================================================+
| Sunflower Studio Tasks | ``src-root/sunflower-studio/sunflower-sri/com.sri.sunflower.distrib.tasks/target/products`` |
+------------------------+----------------------------------------------------------------------------+
| Sunflower Studio CE    | ``src-root/sunflower-studio/sunflower-open/com.sri.sunflower.distrib.core/target/products`` |
+------------------------+----------------------------------------------------------------------------+
| Floralib               | ``src-root/sunflower-foundation/floralib/target``                                      |
+------------------------+----------------------------------------------------------------------------+
| Floralib External      | ``src-root/sunflower-foundation/floralib-ext/target``                                  |
+------------------------+----------------------------------------------------------------------------+

Atom Version: 1.7.4
System: Mac OS X 10.10.5
Thrown From: table-editor package, v0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of undefined

At /Users/jklo/.atom/packages/table-editor/lib/table-formatter.coffee:65

TypeError: Cannot read property 'replace' of undefined
    at TableFormatter.module.exports.TableFormatter.linesEqual (/Users/jklo/.atom/packages/table-editor/lib/table-formatter.coffee:65:10)
    at TableFormatter.module.exports.TableFormatter.getSelectionRanges (/Users/jklo/.atom/packages/table-editor/lib/table-formatter.coffee:160:18)
    at Object.module.exports.TableEditor.formatTable (/Users/jklo/.atom/packages/table-editor/lib/table-editor.coffee:181:7)
    at atom-text-editor.subscriptions.add.atom.commands.add.table-editor:next-cell (/Users/jklo/.atom/packages/table-editor/lib/table-editor.coffee:33:37)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:00.9.0 table-editor:next-cell (atom-text-editor.editor.is-focused.table-editor-active)

Config

{
  "core": {}
}

Installed Packages

# User
angularjs, v0.3.4
angularjs-styleguide-snippets-es6, v1.0.3
atom-html-preview, v0.1.19
autocomplete-python, v1.7.3
color-picker, v2.1.1
dockerletion, v0.2.0
editorconfig, v1.4.1
emmet, v2.4.3
file-icons, v1.7.13
fill-line, v1.0.0
highlight-selected, v0.11.2
language-docker, v1.1.6
language-restructuredtext, v0.15.0
line-ending-converter, v1.3.2
linter, v1.11.4
merge-conflicts, v1.4.3
minimap, v4.24.3
minimap-highlight-selected, v4.4.0
open-recent, v5.0.0
python-tools, v0.6.7
rst-preview-pandoc, v0.1.12
symbol-gen, v1.3.0
symbols-tree-view, v0.13.2
table-editor, v0.2.0

# Dev
No dev packages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions