From 11d567604abc544f878a5568d7722a35215b2e65 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Jan 2021 11:30:17 +0800 Subject: [PATCH] feature: support preview image files --- src/Git/Commit.cs | 11 +++++------ src/UI/CommitViewer.xaml | 4 ++++ src/UI/CommitViewer.xaml.cs | 31 +++++++++++++------------------ 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/Git/Commit.cs b/src/Git/Commit.cs index ae3a326a..bfda00c7 100644 --- a/src/Git/Commit.cs +++ b/src/Git/Commit.cs @@ -224,9 +224,9 @@ namespace SourceGit.Git { /// /// /// + /// /// - public List GetTextFileContent(Repository repo, string file, out bool isBinary) { - var data = new List(); + public bool GetTextFileContent(Repository repo, string file, List lines) { var binary = false; var count = 0; @@ -240,19 +240,18 @@ namespace SourceGit.Git { if (line.IndexOf('\0') >= 0) { binary = true; - data.Clear(); + lines.Clear(); return; } count++; - data.Add(new Line() { No = count, Content = line }); + lines.Add(new Line() { No = count, Content = line }); }); if (errs != null) App.RaiseError(errs); } - isBinary = binary; - return data; + return binary; } /// diff --git a/src/UI/CommitViewer.xaml b/src/UI/CommitViewer.xaml index 845df1ff..bc4db91a 100644 --- a/src/UI/CommitViewer.xaml +++ b/src/UI/CommitViewer.xaml @@ -449,6 +449,10 @@ + + + +