-
Notifications
You must be signed in to change notification settings - Fork 0
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
Formatter should considerer the large of a word in aligning #40
Comments
Just to make sure, can you show an example of what you mean? current vs expected examples |
Of course! This is the result of alignment with the current formatter
This is what i think it should be
|
Some thoughs: As a workaround, you could just manually increase spacing in defsrc, enough to fit all items in all deflayers, and use short 3, 4 character aliases in deflayers to make the whole thing not too wide. Column width adjustment for deflayers sounds ok, until you realize that there's no concept of columns from the point of view of kanata (and formatter). What if user does something like this? (I've seen configs like this before):
Which item is which column? At the very least this option can't be enabled by default. At least not on it's own. The only way I see it being implemented, is along some strict grid enforcement, forcing defsrc to look like this:
then we could tell items are which columns |
Got it, the workaround is working great, I’m using it in my current setup I don’t really think the idea of columns is necessary here. In your example, where the keys aren't orthogonal, it should still keep that alignment of the defsrc across all the deflayers. Maybe it could detect the key with the longest character count and add that spacing into the defsrc automatically? so the user don't need to add the spacing into each key manually with the workaround 🤔 |
When I autoformat a file, it aligns the content without considering the length of each word, causing the alignment to appear offset compared to the defsrc
It would be helpful if the parser added padding so that every layer aligns properly with the defsrc
The text was updated successfully, but these errors were encountered: