enhance: remember commit message when exiting (#1166)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-16 16:36:23 +08:00
parent 67255a5529
commit 9606f128e4
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View file

@ -230,6 +230,12 @@ namespace SourceGit.Models
set;
} = 0;
public string LastCommitMessage
{
get;
set;
} = string.Empty;
public Dictionary<string, FilterMode> CollectHistoriesFilters()
{
var map = new Dictionary<string, FilterMode>();

View file

@ -464,6 +464,7 @@ namespace SourceGit.ViewModels
_selectedView = _histories;
_selectedViewIndex = 0;
_workingCopy.CommitMessage = _settings.LastCommitMessage;
_autoFetchTimer = new Timer(AutoFetchImpl, null, 5000, 5000);
RefreshAll();
}
@ -471,6 +472,7 @@ namespace SourceGit.ViewModels
public void Close()
{
SelectedView = null; // Do NOT modify. Used to remove exists widgets for GC.Collect
_settings.LastCommitMessage = _workingCopy.CommitMessage;
var settingsSerialized = JsonSerializer.Serialize(_settings, JsonCodeGen.Default.RepositorySettings);
try