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 @@
+
+
+
+
diff --git a/src/UI/CommitViewer.xaml.cs b/src/UI/CommitViewer.xaml.cs
index 3121fd10..12d192fe 100644
--- a/src/UI/CommitViewer.xaml.cs
+++ b/src/UI/CommitViewer.xaml.cs
@@ -446,21 +446,6 @@ namespace SourceGit.UI {
grid.FrozenColumnCount = 1;
grid.ContextMenuOpening += OnPreviewContextMenuOpening;
grid.RowStyle = FindResource("Style.DataGridRow.NoBringIntoView") as Style;
- grid.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, (o, e) => {
- var items = (o as DataGrid).SelectedItems;
- if (items.Count == 0) return;
-
- var builder = new StringBuilder();
- foreach (var item in items) {
- var line = item as Git.Commit.Line;
- if (line == null) continue;
-
- builder.Append(line.Content);
- builder.AppendLine();
- }
-
- Clipboard.SetText(builder.ToString());
- }));
var colLineNumber = new DataGridTextColumn();
colLineNumber.IsReadOnly = true;
@@ -491,6 +476,10 @@ namespace SourceGit.UI {
previewEditor.Children.Add(splitter);
}
+ private bool IsImage(string path) {
+ return path.EndsWith(".png") || path.EndsWith(".jpg") || path.EndsWith(".jpeg") || path.EndsWith(".ico") || path.EndsWith(".bmp") || path.EndsWith(".svg");
+ }
+
private void OnPreviewContextMenuOpening(object sender, ContextMenuEventArgs e) {
var grid = sender as DataGrid;
if (grid == null) return;
@@ -539,6 +528,7 @@ namespace SourceGit.UI {
private async void FileTreeItemSelected(object sender, RoutedPropertyChangedEventArgs