]> git.feebdaed.xyz Git - 0xmirror/vim.git/commit
runtime(rust): use textwidth=100 for the Rust recommended style
authorAaron Jacobs <jacobsa@google.com>
Tue, 9 Dec 2025 11:43:39 +0000 (12:43 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 9 Dec 2025 11:43:39 +0000 (12:43 +0100)
commit98ef8433b654ee96c57b66348b767edc73a44406
tree9620376b4a79cdfa5dd7f7d517d4b07cdc0a3cce
parentb22c145c2262c5c2f5b747ea5aece7f6e4858273
runtime(rust): use textwidth=100 for the Rust recommended style

The help text here said 99 was the recommended style for the standard
library, but I can't find a citation for this anywhere. In contrast the
Rust Style Guide hosted on rust-lang.org
[says](https://doc.rust-lang.org/stable/style-guide/#indentation-and-line-width)
the maximum line width is 100, and rustfmt
[agrees](https://github.com/rust-lang/rust/blob/37aa2135b5d0936bd13aa699d941aaa94fbaa645/src/tools/rustfmt/src/config/options.rs#L570).

Having the two disagree causes an annoying off-by-one error in vim: if
you configure vim to highlight too-long lines then it will occasionally
complain about a line that rustfmt refuses to fix.

closes: #18892

Signed-off-by: Aaron Jacobs <jacobsa@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/ft_rust.txt
runtime/ftplugin/rust.vim