Thanks for that Edward. I had a "random dehoist" again. Here's the sequence of events I captured. I don't see any obvious reason why the tree should dehoist. Hopefully this makes sense, and is helpful for you.
================
This is the text I was editing, in one node, typing line N, then copying text from another node and pasting it as line N+1.
line N: local level = t[2]
line N+1: print(indent_text(tostring(s), 2*level))
Here's the view-lossage output; I've added annotations to the right:
l {start typing line N}
o
c
a
l
Space
l
e
v
e
l
Space
=
Space
[
2
]
BackSpace {noticed the error, backspaced to correct it}
BackSpace
BackSpace
t
[
2
] {finished typing line N}
Return {after the Return, I clicked on another node to copy and paste some code}
Ctrl+c {selected text with the mouse, copied it, then clicked back to the target node}
Ctrl+v {pasted the text}
Ctrl+s {saved, as I do frequently - it is here that my hoisted subtree dehoisted}
v
i
e
w
-
l
o
s
s
a
g
e
Return