Skip to content

Better handling of "No newline at end of file" marker #5

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

romamik
Copy link

@romamik romamik commented May 14, 2025

Fixes #4.

Now the parser checks for every line if it is followed by the "No newline at end of file" line, and saves it with the line. This flag is later used to determine this status for the hunk and then for the file.

Also, I renamed the flag to missing_newline as for me, it was hard to wrap my head around the inverted logic of the previous flag. I know that the original marker has negated meaning and that is the main source of confusion, but having variables that are opposite to the marker present in file was an additional source of confusion to me.

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.

"No newline at end of file" can be non-trailing
1 participant