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

Cursor is moved back after writing ... in a construction site #31

Open
cdfa opened this issue Feb 7, 2022 · 0 comments
Open

Cursor is moved back after writing ... in a construction site #31

cdfa opened this issue Feb 7, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@cdfa
Copy link
Owner

cdfa commented Feb 7, 2022

When we use the empty construction site syntax ... in a construction site that contains a syntax error (e.g. (...), the cursor is moved back 3 spaces. This happens because the editor needs to account for the disappearance of the 3 dots when they are replaced by a 0-width empty construction site, but it's erroneously also doing this when the parsing of the construction site with the 3 dots fails.

To fix this, we need to add custom state to the parser that backtracks when a parse fails (as described in the Megaparsec tutorial).

@cdfa cdfa added the bug Something isn't working label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant