Skip to content

line operations in code blocks don't work right #27

@jaked

Description

@jaked

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions