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

Auto addition of #| messes code on "return" #426

Open
mcanouil opened this issue Apr 26, 2024 · 1 comment
Open

Auto addition of #| messes code on "return" #426

mcanouil opened this issue Apr 26, 2024 · 1 comment

Comments

@mcanouil
Copy link
Contributor

This can also happen in other less reproducible situations on save.
Currently, the way #| is not really reliable and most of the time causes issues rather than the opposite.

#| should only be added at the beginning of a new line.

Screen.Recording.2024-04-26.at.17.56.41.mov
@juliasilge
Copy link
Collaborator

The handling for #| looks very complicated to me (although part of that is for autocompletion for the YAML options). Maybe some of that could be simplified to instead have an "OnEnter" rule in this file like:

{
    "beforeText": "^\\s*#+\\|",
    "action": { "indent": "none", "appendText": "#| " }
}

This rule results in behavior that is much better.

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

2 participants