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

[bug] automatic fmt is not run for invisible buffers #1442

Closed
VuiMuich opened this issue Jan 4, 2022 · 0 comments · Fixed by #1444
Closed

[bug] automatic fmt is not run for invisible buffers #1442

VuiMuich opened this issue Jan 4, 2022 · 0 comments · Fixed by #1444
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@VuiMuich
Copy link
Contributor

VuiMuich commented Jan 4, 2022

As far as my search on github and my question on the matrix chat went, this has not been reported yet.

Reproduction steps

Here is a minimal Rust code example. Just create a new cargo crate with cargo init test_helix_auto_fmt and place the following example in its src/main.rs:

/* For easiest demonstration simply collapse the file to a single line with `%J` */
fn main() {
    let editor = String::from("Helix");
    print!(
        "This is a one line minimal example to show, how {2} {}{}",
        "does not run automatic 'fmt' when the ", "buffer is not visible in any window.", editor
    );
    return;
}
// Then open a scratch buffer with `:n` and run `:xa!`
// Observe changes to this file have been written but it hadn't been treated by `fmt`.

Then follow the instructions in the comments.

Environment

  • Platform: Manjaro Linux (should be irrelevant though)
  • Helix version: helix v0.5.0-342-gbd0d20a

Expected behaviour

If helix is configured to run fmt on every file write it should be applied to any file that can be written to disk, despite the visibility of its buffer.

@VuiMuich VuiMuich added the C-bug Category: This is a bug label Jan 4, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jan 4, 2022
archseer pushed a commit that referenced this issue Jan 16, 2022
When writing all documents, fmt wouldn't be run.
Run fmt in close all implementation so that all documents
are formatted if necessary.

Fixes: #1442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants