-
Notifications
You must be signed in to change notification settings - Fork 223
refactor: improve diff handling for EOL changes and enhance text diff… #1177
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
Conversation
… display - Updated `Diff.cs` to streamline whitespace handling in diff arguments. - Enhanced `DiffContext.cs` to check for EOL changes when old and new hashes differ, creating a text diff if necessary. - Added support for showing end-of-line symbols in `TextDiffView.axaml.cs` options.
…hitespace messages - Modified the ignore whitespace text in multiple language files to specify that EOF changes are also ignored. - Ensured consistency across all localization files for the patch application feature.
I thought about implementing these changes because I often commit without realising that I have inadvertently changed all the EOFs. I was inspired by what Git Extensions does, which is to report EOFs as changes if you choose to show whitespace. P.S. |
…ing (like before changes)
Please remove the changes about |
Alright |
…noreWS and fixed typo in Text.Diff.IgnoreWhitespace (EOF => EOL)
- use `Command.ReadToEnd` instead of `Command.Exec` to avoid git trims line endings. - use `StringBuilder.Append('\n')` instead of `StringBuilder.AppendLine()` to restore original line endings (we split the original diff output by `\n` not `\r') - there's no need to show file content (the `StreamReader.ReadLine()` will trim line endings) Signed-off-by: leo <[email protected]>
|
Signed-off-by: leo <[email protected]>
|
… display
Diff.cs
to streamline whitespace handling in diff arguments.DiffContext.cs
to check for EOL changes when old and new hashes differ, creating a text diff if necessary.TextDiffView.axaml.cs
options.