diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index da5681d2..263bde30 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -24,12 +24,21 @@ namespace SourceGit.Commands { var chunks = new List(); for (int i = 0; i < size; i++) { +#if NET48 + var ch = text.Substring(i, 1); + if (WORD_SEPS.Contains(ch)) { + if (start != i) chunks.Add(text.Substring(start, i - start)); + chunks.Add(ch); + start = i + 1; + } +#else var ch = text[i]; if (WORD_SEPS.Contains(ch)) { if (start != i) chunks.Add(text.Substring(start, i - start)); chunks.Add(text.Substring(i, 1)); start = i + 1; } +#endif } if (start < size) chunks.Add(text.Substring(start));