Skip to content

Stop adding additional newline when reading from stdin #17

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
Jul 26, 2015

Conversation

joshuarubin
Copy link
Contributor

When reading from stdin, an extra newline character was always being appended to the input. This fixes that.

fragment += chunk;
});

input.on("end", () => {
if (fragment.slice(-1) === "\n") {
fragment = fragment.slice(0,-1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add ; to line ending.

@vvakame
Copy link
Owner

vvakame commented Jul 22, 2015

What use case are you in?
Please tell me what kind of use case.
--stdin option are created for vim-plugin. #9

@joshuarubin
Copy link
Contributor Author

Added the semicolon... sorry too much Go lately. The problem is that every time I save a file in vim using vim-autoformat an additional newline was being appended to the file.

vvakame added a commit that referenced this pull request Jul 26, 2015
Stop adding additional newline when reading from stdin
@vvakame vvakame merged commit 07c7eac into vvakame:master Jul 26, 2015
@vvakame
Copy link
Owner

vvakame commented Jul 26, 2015

@joshuarubin I see. thanks mate!

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