Skip to content

Failed rustfmt call marks the unedited file as modified #14

Open

Description

@dpc00

Claude reports:

When rustfmt fails, the plugin marks the file as modified although nothing changed. Sublime Text build 4215, Windows 11, v0.3.0 (the code is the same on master).

In the failure branch of run_format, self.view.replace(edit, buffer_region, buffer_text) writes the buffer's own text back into itself. Test: a saved, unedited .rs file, ran BeautifyRust with a failing rustfmt call (the --write-mode problem in the v0.3.0 release). Afterwards the tab title had the modified dot, and the window title ended with the dot, with no edits made.
Suggested: remove the replace call; the buffer is not changed by the plugin before the call, so there is nothing to restore. I did not test a patched copy for this one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions