Skip to content
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

Context needed for newline marker #3

Open
svenssonaxel opened this issue Sep 29, 2022 · 2 comments
Open

Context needed for newline marker #3

svenssonaxel opened this issue Sep 29, 2022 · 2 comments

Comments

@svenssonaxel
Copy link
Owner

For high readability, each line should preferably be possible to interpret on it's own, with no context. This is not the case for content lines, as the status markers +, - and are used in both hintful and unified diff format. This means, that looking at the line +hello$, a user is unable to tell whether this adds hello\n (hintful) or hello$\n (unified), without going back to the hunk header or getting help from a highlighter.

@svenssonaxel
Copy link
Owner Author

This is partly alleviated by highlighting.

@svenssonaxel
Copy link
Owner Author

Strictly speaking, this problem is already present in unified diff format, since the --- and +++ lines can be confused with - and + content lines given no context. Some highlighters would work faster if lines could be interpreted on their own, but at least we aren't introducing this problem.

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

No branches or pull requests

1 participant