Skip to content

Conversation

@vince4
Copy link

@vince4 vince4 commented Nov 28, 2025

Short description 📝

Fix issue #145. Add support for Allman style, or whenever the first brace opening the preview is not on the same line as #Preview.

Solution 📦

Check during #Preview line parsing if it contains a brace and should start counting braces or not.
Instead of adding a flag hasBraceOnFirstLine, I preferred to make braceBalance nullable. So we assign 0 only when the last brace is closed.

Tests 🧪

I added a test case with a simple Preview in Allman style and just added an assertion to an existing test : test_loadRawPreviewBodiesDefaultEnableAndUrlIsDirectory.

@BarredEwe
Copy link
Owner

@vince4 Hi!
Great and simple solution. Thanks for the fix!

@BarredEwe BarredEwe merged commit 43f1dc1 into BarredEwe:main Dec 4, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants