zargony / atom-language-rust

Rust language support in Atom - LOOKING FOR MAINTAINER, see #144

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preferred wrap length settings is automatically set back to 100 when both wrap-guide and Rust wrap are set to 72.

fuzhouch opened this issue · comments

Hi folks,

This is a bug I recently found when using Atom with Rust-Language. Repo steps:

  1. Install a clean Atom with default wrap-guide package enabled.
  2. Install Rust-Language package.
  3. Set preferred wrap length in wrap-guide to 72 (recommended check-in length for Git).
  4. Set preferred wrap length in Rust-language to 72 (for same reason).
  5. Open any Rust source code file.

I expect the vertical line in opened source code file window is 72, but actually it will be set to 100.

The issue is not critical, but kinds of confusing because it looks like Rust-Language keeps a fixed line width (99) and don't allow it change.

BTW, I found the workaround is easy: Just make sure the wrap length are different between Rust-Language and default wrap-guide, for example, I set default wrap-guide to 72 but set Rust-language wrap guide to 73. Then the final setting will 73 when opening a Rust source code file.

Also seeing this issue. Mac, Atom 1.14.3, language-rust 0.4.9. Except in my case, I have the default line length of 80 set everywhere (globally, and in language-rust).

Hello @fuzhouch and @josh-berry,
I would like to accept your PR if you made one.
I am sure it is easy to find the reason, but unfortunately none of us have time for this.

Thanks for the detailed bug report

Related issue: #93 (language-rust sets the preferred line length to 99 since this is recommended Rust style, but people are confused about it).

However, I think this is probably not a language-rust issue. Since language-rust is just passing the preferredLineLength of 99 to Atom (which should be overridable in the package settings), I'd suspect that this is an Atom issue rather that this package's issue. Could you maybe report this to the Atom project? It looks like Atom gets confused between the global setting and the package setting. However it might also be that this isn't supported and they didn't intend settings to be used like this