lloeki / ex-mode

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

Bug - Allow os default to save new unsaved file. #231

Open lacostenycoder opened 3 years ago

lacostenycoder commented 3 years ago

steps to reproduce

  1. Open a new tab untiled, add some text
  2. use :w to save

Expected behavior

Allow the default os to name and save the file without error

Actual behavior

MacOS system allows me to save file, but Atom exception is raised.

Atom: 1.54.0 x64 Electron: 6.1.12 OS: macOS 11.0.1 Thrown From: ex-mode package 0.18.0

Stack Trace

Uncaught TypeError: The "path" argument must be one of type string, Buffer, or URL. Received type object

At /Users/lance/.atom/packages/ex-mode/lib/ex-state.coffee:59

TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type object
    at Object.openSync (fs.js:439:10)
    at Object.func (electron/js2c/asar.js:138:31)
    at Object.func [as openSync] (electron/js2c/asar.js:138:31)
    at Object.writeFileSync (fs.js:1206:35)
    at Object.writeFileSync (/packages/ex-mode/node_modules/fs-plus/lib/fs-plus.js:288:17)
    at saveAs (/packages/ex-mode/lib/ex.coffee:51:6)
    at /packages/ex-mode/lib/ex.coffee:249:20
    at trySave (/packages/ex-mode/lib/ex.coffee:20:16)
    at Ex.write (/packages/ex-mode/lib/ex.coffee:249:9)
    at Ex.w (/packages/ex-mode/lib/ex.coffee:257:6)
    at /packages/ex-mode/lib/ex.coffee:1:1
    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/static/<embedded>:11:350382)
    at KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1230982)
    at KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1227116)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:284879)

Commands

  3x -3:50 blur (input.hidden-input)
     -3:46.1.0 editor:newline (input.hidden-input)
  7x -3:25.9.0 core:backspace (input.hidden-input)
     -1:06.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -1:05.7.0 vim-mode-plus:insert-below-with-newline (input.hidden-input)
     -1:03.5.0 core:backspace (input.hidden-input)
     -1:03.2.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -1:02.7.0 ex-mode:open (input.hidden-input)
  3x -1:02.7.0 blur (input.hidden-input)
     -1:01.5.0 editor:consolidate-selections (input.hidden-input)
     -1:01.5.0 core:cancel (input.hidden-input)
  3x -1:01.5.0 blur (input.hidden-input)
     -0:54.2.0 ex-mode:open (input.hidden-input)
  3x -0:54.2.0 blur (input.hidden-input)
     -0:53.2.0 core:confirm (input.hidden-input)
  6x -0:52.2.0 blur (input.hidden-input)

Non-Core Packages

ex-mode 0.18.0 
vim-mode-plus 1.36.4 
vim-mode-zz 0.2.0 
vim-surround 0.8.1