This PR fixes two issues I noticed when swapping between the Message Input and EDITOR:
The EDITOR is initialized empty (CreateTemp generates an empty file), even if the user had already typed something.
When returning from the EDITOR, a newline is appended for some reason (tested with neovim and nano)
Issue 1 is solved by writing the contents of the Message Input to the temp file.
Issue 2 is solved by trimming leading and trailing whitespace, as Discord already does that after the message is sent.
Hi!
This PR fixes two issues I noticed when swapping between the Message Input and EDITOR:
Issue 1 is solved by writing the contents of the Message Input to the temp file. Issue 2 is solved by trimming leading and trailing whitespace, as Discord already does that after the message is sent.
Cheers!