Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jaked opened this issue Oct 26, 2021 · 0 comments
Open

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

jaked opened this issue Oct 26, 2021 · 0 comments

Comments

@jaked
Copy link
Owner

jaked commented Oct 26, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant