-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Separate lines in code or liveCode blocks are all in the same text node, separated by newlines; so line-oriented operations don't work right. For example, control-k to delete to the end of a line deletes to the end of the block.
One way to fix it would be to specialize all the relevant editing operations in code blocks: split the single text node at newlines and do the right thing.
Another way to fix it would be to put each line in a separate node (wrapping a text node) so the default editing operations work correctly. It would be a little more difficult to do parsing / highlighting, and existing documents would need upgrading.
Yet another way would be to make code blocks into voids with a non-Slate editor. This would avoid the need to reimplement a bunch of code editor stuff, but having a hybrid editor would probably complicate other things.