lloeki / ex-mode

Ex mode for Atom
MIT License
169 stars 59 forks source link

:enew command, Uncaught TypeError: Cannot read property 'createReadStream' of undefined #214

Closed trusktr closed 6 years ago

trusktr commented 6 years ago

[Enter steps to reproduce:]

  1. make a horizontal split
  2. try :enew

Atom: 1.27.1 x64 Electron: 1.7.15 OS: Mac OS X 10.13.4 Thrown From: ex-mode package 0.18.0

Using with vim-mode-plus:

debug info with package info ```json { "atom": "1.27.1", "platform": "darwin", "release": "17.5.0", "vmpVersion": "1.32.0", "vmpConfig": { "automaticallyEscapeInsertModeOnActivePaneItemChange": true, "keymapYToYankToLastCharacterOfLine": true, "wrapLeftRightMotion": true, "blackholeRegisteredOperators": [], "startInInsertModeScopes": [], "charactersToAddSpaceOnSurround": [], "highlightSearchExcludeScopes": [], "flashOnOperateBlacklist": [] }, "activeCommunityPackages": [ "atom-material-syntax: 1.0.8", "atom-vim-like-tab: 1.5.1", "ex-mode-sort: 1.0.0", "hey-pane: 1.1.0", "highlight-line: 0.12.0", "highlight-selected: 0.13.1", "keystroke: 0.4.0", "minimap: 4.29.8", "minimap-highlight-selected: 4.6.1", "minimap-quick-highlight: 1.0.1", "one-tab: 0.10.0", "quick-highlight: 0.13.0", "teletype: 0.13.2", "vim-mode-plus: 1.32.0", "vim-mode-plus-keymaps-for-surround: 0.2.1", "language-pug: 0.0.22", "platformio-ide-terminal: 2.8.1", "ex-mode: 0.18.0" ] } ```

Stack Trace

Uncaught TypeError: Cannot read property 'createReadStream' of undefined

At /Users/trusktr/src/trusktr dotfiles/.atom/packages/ex-mode/lib/ex-state.coffee:59

TypeError: Cannot read property 'createReadStream' of undefined
    at TextBuffer.module.exports.TextBuffer.load (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1498:81)
    at Ex.enew (/packages/ex-mode/lib/ex.coffee:211:12)
    at Command.execute (/packages/ex-mode/lib/command.coffee:197:9)
    at ExState.processOpStack (/packages/ex-mode/lib/ex-state.coffee:53:17)
    at ExState.pushOperations (/packages/ex-mode/lib/ex-state.coffee:43:6)
    at ExViewModel.ViewModel.confirm (/packages/ex-mode/lib/view-model.coffee:13:14)
    at ExViewModel.module.exports.ExViewModel.confirm (/packages/ex-mode/lib/ex-view-model.coffee:56:5)
    at ExViewModel.confirm (/packages/ex-mode/lib/ex-view-model.coffee:1:1)
    at HTMLDivElement.ExCommandModeInputElement.confirm (/packages/ex-mode/lib/ex-normal-mode-input-element.coffee:53:16)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:110:40)

Commands

     -0:18.4.0 command-palette:toggle (input.hidden-input)
  3x -0:18.4.0 blur (input.hidden-input)
     -0:18.1.0 keystroke cmd-P (input.hidden-input)
     -0:18.1.0 command-palette:toggle (input.hidden-input)
  2x -0:18.1.0 blur (input.hidden-input)
     -0:17.2.0 ex-mode:open (input.hidden-input)
  3x -0:17.2.0 blur (input.hidden-input)
     -0:14.3.0 ex-mode:close (input.hidden-input)
  3x -0:14.3.0 blur (input.hidden-input)
     -0:12.4.0 pane:split-down-and-copy-active-item (input.hidden-input)
  6x -0:12.4.0 blur (input.hidden-input)
  3x -0:11.8.0 vim-mode-plus:move-up (input.hidden-input)
     -0:11.2.0 ex-mode:open (input.hidden-input)
  3x -0:11.2.0 blur (input.hidden-input)
     -0:10.1.0 core:confirm (input.hidden-input)
  3x -0:00.1.0 blur (input.hidden-input)

Non-Core Packages

atom-browser 0.68.0 
atom-material-syntax 1.0.8 
atom-vim-like-tab 1.5.1 
atom-webbrowser 2.1.4 
browser-plus 0.0.98 
ex-mode 0.18.0 
ex-mode-sort 1.0.0 
hey-pane 1.1.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
keymap-control 1.2.0 
keystroke 0.4.0 
language-pug 0.0.22 
minimap 4.29.8 
minimap-highlight-selected 4.6.1 
minimap-quick-highlight 1.0.1 
moonlight 0.7.0 
narrow 0.65.0 
narrow-git-ls 0.2.0 
one-tab 0.10.0 
open-this 0.5.0 
pane-browser 1.6.0 
paner 1.0.0 
platformio-ide-terminal 2.8.1 
quick-highlight 0.13.0 
teletype 0.13.2 
toggle 0.6.2 
toggle-quotes 1.1.0 
tomorrow-night-eighties-syntax 1.0.2 
vim-mode-plus 1.32.0 
vim-mode-plus-ex-mode 0.11.0 
vim-mode-plus-keymaps-for-surround 0.2.1 
vim-mode-plus-macros 0.1.2 
vim-mode-plus-move-selected-text 0.12.0 
hultberg commented 6 years ago

Looks like this command has been broken since atom v1.18.0. I could recommend the command "Ctrl + N" or "Application: New file"

Selfnote: The behaviour in text.buffer has changed, it might have been because of this commit https://github.com/atom/text-buffer/commit/51b0185870c6ccfb8d33154ebd49139127f86d07 Must investigate more.