`fix` command injects without replacing.
drahnr opened this issue · comments
Describe the bug
With the fix
subcommand, the wrong segment is replaced under some unknown conditions.
To Reproduce
Steps to reproduce the behaviour:
- A file containing
/// With all patches applied.
///
/// Nothing todo, there is no line in need of a reflow.
///
/// Verify the individual patches are as expected.
struct Foo;
- Run
cargo spellcheck fix
- ...
Expected behavior
The shown segment is replaced.
Please complete the following information:
- System: Fedora 33
- Obtained: git,cargo
- Version:
v0.8.0
Additional context
The underlying issue is that both nlprule
and hunspell
detect to do
as something that needs fixing. Both now modify the span of to do
, and the secondary bandaid
just messes it up.
One solution would be to do this in a multi pass fashion, checker after checker with potential intermediate user interaction, store it and run the second checker.