mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
enhance: only show two chars when they are all ascii letters or digits (#585)
This commit is contained in:
parent
a5e783da08
commit
3296f90feb
1 changed files with 2 additions and 3 deletions
|
@ -128,10 +128,9 @@ namespace SourceGit.Views
|
|||
foreach (var part in parts)
|
||||
chars.Add(part[0]);
|
||||
|
||||
if (chars.Count >= 2)
|
||||
if (chars.Count >= 2 && char.IsAsciiLetterOrDigit(chars[0]) && char.IsAsciiLetterOrDigit(chars[^1]))
|
||||
return string.Format("{0}{1}", chars[0], chars[^1]);
|
||||
if (chars.Count == 1)
|
||||
return string.Format("{0}", chars[0]);
|
||||
|
||||
return name.Substring(0, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue