-
Notifications
You must be signed in to change notification settings - Fork 19
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
String editing #95
Comments
One more observation: when e.g. replacing XML tag However there's and interesting issue - if string edit mode will work like insert mode in vim then you can't undo until you leave it but you can't leave it in invalid state. Some ways to resolve this:
Also the error returned from validation should contain some kind of span with list of invalid characters. |
Extra features stuff: allow all languages to define node tags/discriminants. Then user could |
Yeah this makes sense - it's pretty much in line of what I was thinking. I'm still not sure of the best way to represent nodes at all, but 'stringly' nodes are so ubiquitous that any decent architecture needs to handle them correctly. My current feeling is that it would be nice to have only one
Don't stress about it - there's no pressure. I'm personally quite busy with my degree project right now, and I'm not usually in the mood for making more projects after a day of coding crazy projects in Rust. I really don't want to fully back-burner Sapling, though, so I'll keep streaming and doing stuff albeit slower than usual. |
I think this another example of where allowing nodes to be temporarily invalid makes a huge difference to the complexity of the rest of the code (the existing one being how unbelievably janky the existing replace code is).
I suspect this might be the easiest strategy - though I agree it might be hard to understand and implement. |
I have an rough idea for how to do things like this once multiple cursors are a thing:
It seems like a lot of steps, but each step can be reused for a lot of different things (e.g. the first 3 steps can be used to delete all the |
Sooner or later we need to figure out how to do string editing - e.g.
"foo"
in Json or<foo>
in XML.I only have a rough idea now, but some things that make sense to me:
The API of stringly node can be described by this trait (which may or may not be an actual trait)
I imagine this flow (pseudo code):
OT: so far I didn't have as much time to look at XML as I wished. I'm doing it now and maybe a bit tomorrow but I don't feel that great so I may be unable to finish it.
The text was updated successfully, but these errors were encountered: