I am having trouble doing something relatively simple, and I think I could use some help.
My language has indented blocks of statements that are not surrounded by braces, much like Python. I want to make it easy for a user to finish a block of code and continue writing un-indented statements.
In the base language, this is easy to do by typing within the braces and simply moving the cursor past the brace when ready to insert another high-level child. If I am not using braces, one simple thing I can do is have an empty cell as the end tag. However, this end tag is always on another line because the indented block adds a newline after every child, and a user would expect to be able to type on this line, but is unable to.
What is a solution for this? Some things that would work would be:
Somehow always have an extra EmptyLine child at the highest lever so the cursor can be moved to it (but how?)
If a user deletes an empty line, end the block and create a sibling for it. I guess I would make a DELETE action map here, but how would I check that the EmptyLine was the last child in the block? I've been having a lot of trouble doing anything with action maps.
If the user is about to type a third EmptyLine in a row at the end of a block, end that block and insert an empty line on the next line instead. Once again, I can't figure out how to check this in an action map.
Any help is really appreciated.