atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.48k stars 235 forks source link

[memo] Extra methods for Buffers #164

Closed probablycorey closed 5 years ago

probablycorey commented 5 years ago

There is no way to get the path of a Buffer. This would be handy because we've been passing the buffer around and display it's path in the UI. Having a getPath method would probably be the best option because it will work even if the Buffer is renamed.

Things get a little weird with deletes. For now I think it would be fine to consider that trying to open a buffer to a deleted file raises an error. Alternatively we could add a getStatus method to the buffer so we could detect if the file is deleted and treat is differently.