textlint-rule / textlint-rule-ginger

textlint rule to check your English grammar with Ginger Proofreading
6 stars 3 forks source link

textlint --fix doen't work correctly. #77

Closed tani closed 5 years ago

tani commented 5 years ago

This plugin fails in this case

I love you.
I has a pens.

I guess the reason is that this library calculate position to fix by the column.

tani commented 5 years ago
        const originalRange = [
          originalPosition.column,
          originalPosition.column + correction.length,
        ];
azu commented 5 years ago

We would use originalIndexFromIndex(generatedIndex): number instead of originalPositionFromIndex?

https://github.com/textlint-rule/textlint-rule-ginger/blob/3f65ef822ea8d1936793830673ba91e713ea868e/src/ginger.js#L72-L76

tani commented 5 years ago

Yes, it's better way. Now I testing it locally. Please wait few minutes...

tani commented 5 years ago

It passed exists tests, now I add a test case for this issue.

tani commented 5 years ago

I added them, thank you.