Skip to content

Commit 9f541bd

Browse files
committed
enhance: auto-select the latest running git command log and auto-scroll to the end when new content is append to current viewing log (#1842)
Signed-off-by: leo <longshuang@msn.cn>
1 parent 39d1c01 commit 9f541bd

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/ViewModels/ViewLogs.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public CommandLog SelectedLog
1919
public ViewLogs(Repository repo)
2020
{
2121
_repo = repo;
22+
_selectedLog = repo.Logs?.Count > 0 ? repo.Logs[0] : null;
2223
}
2324

2425
public void ClearAll()

src/Views/CommandLogContentPresenter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ public string PureText
9393
TextArea.TextView.Margin = new Thickness(4, 0);
9494
TextArea.TextView.Options.EnableHyperlinks = false;
9595
TextArea.TextView.Options.EnableEmailHyperlinks = false;
96+
TextArea.TextView.Options.AllowScrollBelowDocument = false;
9697
}
9798

9899
public void OnReceiveCommandLog(string line)
99100
{
100101
AppendText("\n");
101102
AppendText(line);
103+
ScrollToEnd();
102104
}
103105

104106
protected override void OnLoaded(RoutedEventArgs e)

0 commit comments

Comments
 (0)