Alt+arrows editor undo/redo fix

This is the same as PR #882 by DCubix, but I fixed it so undo/redo is supported. (I wasn't sure how to just add the fix to his PR.)

It doesn't move everything to functions, just adds the undo/redo support. Hoping it can be in 1.0 since the alt+arrows in rc1 don't work properly and don't support undo/redo at all.