Can you show me the code that creates node.editor in your oneditprepare? It should not be a no-op function, it should call to the ACE or MONACO internal equivalent function.
Could you add console.log("editor", this.editor, this.editor.getValue())
Restart node-red
Edit your node (change the text)
Press "Done"
Check the console?
I can, but this.editor.getValue() is not the problem, it does return the modified content. The problem is that the assignment to this.source doesn't do anything.
I'm wondering whether the after the oneditsave the editor itself copies the values from the input fields into this, thereby overwriting this.source. Either way, what's in the docs doesn't work.
Part of the problem is that the docs don't describe at all in what context the onedit* functions run. What is this bound to? What happens in the editor itself before & after each one of these callbacks?
The node. Typically, at the start of oneditprepare and oneditsave I put const node = this then everywhere in the code i write node.query = xxx; This way, i need not worry about scope or callbacks affecting this
Lots. Too much to describe & not (completely) documented but in simple terms, it generates the form, links up the variables to ids and hooks up events.
Is your issue fixed? Please mark the solution if so.