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

Flawed support for Allman / BSD / GNU-style brace-placement? (Braces on a line by themselves.) #119

Open
Heathcliff77 opened this issue Mar 21, 2024 · 2 comments

Comments

@Heathcliff77
Copy link

I am experiencing that origami behaves poorly when dealing with code where braces are placed on a line by themselves.
See the gif-recording below, the command I issue is origami-recursively-toggle-node

Origami folds nicely when braces are placed according to K&R style, but poorly for Allman / BSD / GNU-style.
For example, trying to fold the if on line 6 folds the entire function foo(), which is not what you would expect or want to happen.

Peek 2024-03-21 12-43

@gregsexton
Copy link
Owner

Put the point on the brace you want to fold. There are commands that can help with this, such as origami-forward-fold.

@Heathcliff77
Copy link
Author

Hello Greg, I'm happy to see such a quick reply.

My standpoint is that if origami was working properly, it would be possible to have the cursor placed at the beginning of L6 and issue a command that would fold the body of the if, not the entire function foo().

Is such behavior possible with origami? If so, can you elaborate how to achieve that?

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