Re: [PATCH 1/4] editorconfig: set maximum line length to 120 characters
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jun 30, 2025, 08:29 UTC
- Message-ID
- <CAOLa=ZTVgEFSES0iv2kLftsDJ27cULo1F1XuJLHURWimuOm5-g@mail.gmail.com>
- In-Reply-To
- <4xcovwt5f2garsngqtzzcrn7755in4xkq6zxxk5smeo4d2vfp4@l7cqb2lizf65>
Justin Tobler <jltobler@gmail.com> writes:
Show 36 quoted lines
> On 25/06/27 01:51AM, Karthik Nayak wrote: >> Justin Tobler <jltobler@gmail.com> writes: >> >> > On 25/06/25 06:43PM, Karthik Nayak wrote: >> >> As per 'Documentation/CodingGuidelines', we try to keep to at most 80 >> >> characters per line. However, there are often certain cases where we >> >> extend this for the sake of readability. >> >> >> >> Add a maximum limit of 120 characters to the '.editorconfig'. This means >> >> that if an individual line exceeds 120 characters, the editor will wrap >> >> that line. This provides a lot wiggle room over the recommended 80 >> >> character limit. >> > >> >> Hello Justin, >> >> > I frequently use the format operator in vim to reformat entire blocks of >> > text and it is commonly configured to use `max_line_length` from an >> > `.editorconfig` file to know when to wrap lines. Changing the value to >> > 120 would cause my editor to prefer 120 character lines when >> > reformatting, which I would personally not like. >> > >> >> It would only wrap lines longer than 120 columns. Currently editorconfig >> doesn't wrap any line length. So we're essentially saying, any line >> above 120 is not something we want to accept and hence wrap. This >> doesn't mean that shorter lines will be combined together. Wouldn't this >> be better than the current situation? > > When `max_line_length` is set in a ".editorconfig" file, in my vim > editor it overrides the `textwidth` configuration which was already set > to 80 by default. So changing to 120 would change line wrapping behavior > for me at least. I could disable using the ".editorconfig", but I would > prefer to avoid doing that :) > > -Justin
Thanks for explaining. So it seems like vim in this case _does_ combine shorter lines to fit to 120 columns when formatting a block, this is not something we desire. So let me drop this patch.
- Karthik