8000 Fix `--stdin` append newline by phanen · Pull Request #232 · huacnlee/autocorrect · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix --stdin append newline #232

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

Merged
merged 2 commits into from
Mar 17, 2025
Merged

Conversation

phanen
Copy link
Contributor
@phanen phanen commented Jan 13, 2025

Regression of 60f7953.

reproduce

echo "hello你好" | cargo run -q -- --stdin

Expected:

hello 你好

Result:

hello 你好

@huacnlee
Copy link
Owner
huacnlee commented Jan 13, 2025

This is bug, but it looks like not fixed by this change, this is not the right way to solve same issue.

@phanen
Copy link
Contributor Author
phanen commented Jan 14, 2025

Weird, it works on my machine, then how about now? I just silent the println cause the issue.

Result of make test:stdin:

hello 你好
{"count": 1,"messages": [{"filepath":"<STDIN>","lines":[{"l":1,"c":1,"new":"hello 你好","old":"hello你好","severity":1}],"error":""}]}
.<STDIN>:1:1
-hello你好
+hello 你好


Error: 1, Warning: 0
AutoCorrect spend time: 398.284ms

make: *** [Makefile:25: test:stdin] Error 1

Sorry again if I do something wrong. But I think that's easy and quick one-line fix. It would be better if log never print to stdout when people just do piping to get result of --stdin mode, that's why I just set --quiet before.

@huacnlee huacnlee merged commit 7d5db55 into huacnlee:main Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0