s-kostyaev / ellama

Ellama is a tool for interacting with large language models from Emacs.
GNU General Public License v3.0
378 stars 27 forks source link

Ellama's answers should be a unique buffer modification #15

Closed Docteur-Lalla closed 8 months ago

Docteur-Lalla commented 8 months ago

Hello there,

When using commands such as ellama-change-code, the answer written to the current buffer should be one atomic modification that can be undone all at once instead of being as many insertions as needed. The reason behind that is that if a user is not satisfied by the changes they should be able to rollback from calling ellama with one undo. Nonetheless, the current behavior imposes the user to undo as many changes as needed and sometimes it is not even possible since the number of registered modifications is too large. The only option being to first save the file, then call ellama and be prepared to kill the buffer without saving to reopen the file if the changes are not recoverable.

This would prevent users from losing code if they did not think of saving their work before asking ellama to generate the doc (like I did :^) )

Thank you in advance.

s-kostyaev commented 8 months ago

Thank you for the feedback. I will think how to do it.

s-kostyaev commented 8 months ago

Fixed. Will be in melpa soon. Feel free to reopen if your issue isn't fixed.