howl-editor / howl

The Howl Editor
http://howl.io
Other
712 stars 68 forks source link

Feature Request: Save file from buffer list #521

Open Janfel opened 5 years ago

Janfel commented 5 years ago

As you can close a buffer from the buffer list with Ctrl+w, it would be nice to also be able to save it with Ctrl+s. This seems to be a perfect fit for being implemented on top of the changes proposed in issue #331.

shalabhc commented 4 years ago

I was looking into this and realized there's some inconsistency in how close and save are implemented. Specifically close_buffer is available on the howl.app but save_buffer isn't. It is implemented as a command where the interaction happens in input and handler. However for close the interaction happens in app\close_buffer so the command is just:

   handler: ->
    buffer = app.editor.buffer
    app\close_buffer buffer

This makes it simple to call app\close_buffer from inside the buffer list interaction. I think for consistency we should first add the save_buffer and save_buffer_as to app.