A potentially better solution that also allows you to use all the functionality of your text editor (in addition to saving input form text in your editor's scratch buffer that survives a crash without core dumps) is to use the GhostText plugin on input forms

Though the best design would be for the OS to be extensible and allow you to use your text editor in any text input form, this way you'd have to care about a lot fewer apps disrespecting users by easily loosing user input

You can achieve this with native messaging [0] in tridactyl [1]:

https://github.com/tridactyl/tridactyl/blob/850acdf2ca11018e...

It's really cool, I've added an option to open these windows in floating mode automatically in my sway config through another application name iirc. Ans then I press a simple shortcut, and it opens my editor (Helix) with the already entered text and once I close it, it'll transfer the text from that temporary file which was open in your editor to the the input field/textare again.

[0] https://github.com/tridactyl/native_messenger [1] https://github.com/tridactyl/tridactyl