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

comments_min_spaces_from_content effect in comment lines #241

Closed
colluca opened this issue May 5, 2023 · 2 comments
Closed

comments_min_spaces_from_content effect in comment lines #241

colluca opened this issue May 5, 2023 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@colluca
Copy link

colluca commented May 5, 2023

Description

When you have a comment such as:

################
# Some section #
################

the comments_min_spaces_from_content setting will have an effect on the second line, producing (e.g. for a value of 2):

################
# Some section  #
################

I would argue that this shouldn't be the case, as the # Some section string is not properly "content", and instead makes this setting unusable for proper "content" as it must be fixed to 1 to format comment headers such as the one above nicely.

Desired behavior

The setting above should be ignored after the start of a comment (i.e. after the first # in a line). So for whatever value of comments_min_spaces_from_content it should not alter the original comment:

################
# Some section #
################
@colluca colluca added the bug Something isn't working label May 5, 2023
@lyz-code
Copy link
Owner

lyz-code commented May 6, 2023

Hi @colluca thanks for taking the time to open the issue. I feel this is a corner case that can be solved by adding the same number of spaces before the section name, for example:

##################
#  Some section  #
##################

Thus I don't think it's worth the complexity increase to handle this specific case. Having said that, the solution at a first look seems easy (just tweak this conditional) if you want to make a PR and it doesn't look hard to maintain I'm fine with accepting it

@lyz-code lyz-code added help wanted Extra attention is needed good first issue Good for newcomers labels May 6, 2023
@lyz-code
Copy link
Owner

Duplicate of #231

@lyz-code lyz-code marked this as a duplicate of #231 May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants