Osmose / advanced-open-file

Open files and folders in Atom easily.
https://atom.io/packages/advanced-open-file
Other
118 stars 20 forks source link

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined #69

Closed averrin closed 8 years ago

averrin commented 8 years ago

aof

  1. Press Tab

Atom Version: 1.2.0-beta1 System: Ubuntu 15.10 Thrown From: advanced-open-file package, v0.12.2

Stack Trace

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

At /home/user/.atom/packages/advanced-open-file/lib/models.js:200

TypeError: Cannot read property 'toLowerCase' of undefined
    at Function.commonPrefix (/home/user/.atom/packages/advanced-open-file/lib/models.js:200:50)
    at AdvancedOpenFileController.autocomplete (/home/user/.atom/packages/advanced-open-file/lib/controller.js:151:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom-beta/resources/app.asar/src/command-registry.js:260:29)
    at /usr/share/atom-beta/resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:528:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:351:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/usr/share/atom-beta/resources/app.asar/src/window-event-handler.js:99:36)
    at HTMLDocument.<anonymous> (/usr/share/atom-beta/resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:37.4.0 vim-mode:move-to-next-word (atom-text-editor.editor.vim-mode.is-focused.operator-pending-mode)
     -0:32.6.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  4x -0:32.5.0 vim-mode:move-down (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
  8x -0:31.6.0 vim-mode:move-left (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:30.1.0 vim-mode:change (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:30.1.0 vim-mode:move-to-next-word (atom-text-editor.editor.vim-mode.is-focused.operator-pending-mode)
     -0:26.1.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:25.8.0 vim-mode:insert-after-end-of-line (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:25.4.0 emmet:insert-formatted-line-break-only (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:25.3.0 editor:newline (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:23.7.0 vim-mode:activate-normal-mode (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:19.3.0 vim-mode:move-to-start-of-file (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:12.8.0 advanced-open-file:toggle (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -0:12.7.0 blur (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
 14x -0:11.6.0 core:backspace (atom-text-editor.path-input.editor.mini.is-focused)
  5x -0:07.8.0 advanced-open-file:autocomplete (atom-text-editor.path-input.editor.mini.is-focused)

Config

{
  "core": {
    "themes": [
      "accents-ui",
      "base16-tomorrow-dark-theme"
    ],
    "disabledPackages": [
      "web-browser",
      "tool-bar-main",
      "atom-jade",
      "spell-check",
      "seti-icons",
      "atom-color-highlight",
      "local-history",
      "project-view",
      "tool-bar",
      "toolbar-basic",
      "background-tips",
      "image-view",
      "language-csharp",
      "linter-tidy",
      "deprecation-cop",
      "linter-python-pyflakes",
      "opened-files",
      "hyperclick",
      "symbol-gen",
      "symbols-view",
      "symbols-tree-view",
      "run-command",
      "devdocs"
    ],
    "excludeVcsIgnoredPaths": false,
    "autoHideMenuBar": true
  }
}

Installed Packages

# User
MagicPython, v0.5.0
Zen, v0.16.3
accents-ui, v1.1.0
advanced-open-file, v0.12.2
api-docs, v0.0.3
atom-ctags, v4.4.0
atom-jinja2, v0.5.0
auto-reveal-in-sidebar, v0.8.0
autocomplete-paths, v1.0.2
autocomplete-python, v0.10.3
color-picker, v2.0.13
color-picker-service, v0.0.1
color-tabs, v0.1.8
color-tabs-regex, v0.2.2
emmet, v2.3.14
file-icons, v1.6.11
foldername-tabs, v0.1.5
git-hide, v0.1.2
github-notifications, v0.1.1
javascript-snippets, v1.0.0
language-babel, v2.3.0
language-diff, v0.3.1
language-javascript-better, v1.7.1
language-javascript-jsx, v0.3.7
language-lua, v0.9.4
language-nunjucks, v2.0.0
last-cursor-position, v0.9.0
linter, v1.10.0
linter-eslint, v4.0.0
linter-jscs, v3.2.0
linter-jshint, v1.2.1
linter-pep8, v1.0.1
linter-pylama, v0.2.0
minimap, v4.16.0
minimap-bookmarks, v0.1.0
minimap-git-diff, v4.1.8
minimap-highlight-selected, v4.3.1
minimap-pigments, v0.1.7
nerd-treeview, v0.3.1
pigments, v0.18.1
python-iresolve, v0.0.3
python-tools, v0.6.5
quick-highlight, v0.3.7
remember-file-positions, v0.2.0
swackets, v0.7.0
sync-settings, v0.6.0
tidy-tabs, v0.3.0
time-status, v1.1.0
underline-trailing-whitespace, v1.4.0
vim-mode, v0.63.0
wakatime, v5.0.0

# Dev
No dev packages
Osmose commented 8 years ago

Thanks for the report! I'll try looking at it tonight.

Also that modal is GORGEOUS

Osmose commented 8 years ago

This should be fixed in master. It was trying to find the common prefix between those two paths, and since they both matched up to the end of planning, it tried to go a character past the end of the path and got undefined instead of a character.

I'll do an actual release later this week or weekend with the fix. In the meantime, if you're able to pull down the latest master and test if the fix works for you I'd appreciate the verification. Thanks again!

natew commented 8 years ago

Also just got this, looking forward to fix!

natew commented 8 years ago

By the way great work on this, it's exactly what I was looking for. Wondering, could it work for doing rename operations?

Osmose commented 8 years ago

By the way great work on this, it's exactly what I was looking for.

Thanks! Glad it's helpful. :D

Wondering, could it work for doing rename operations?

This already got asked in #52 and I rejected the idea as part of this plugin. However, it'd be a neat idea to try in a separate plugin as an enhanced UI for the existing rename command in the command palette.

natew commented 8 years ago

Well, I already use this for new file and open file, why not rename file? Could even make this package "advanced file tree" or something like that.

In my view, it's all the same thing. You're changing the file system. And the interface should be identical. Just thoughts. I love the plugin, trying to recreate what I had with sublime's advanced new file.

cjbottaro commented 8 years ago

Release please? AOF is integral to my workflow and this bug makes it unusable... :(

Osmose commented 8 years ago

Done: https://github.com/Osmose/advanced-open-file/releases/tag/v0.12.3

cjbottaro commented 8 years ago

AOF works again! Awesome, thank you.