mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
enhance: remember commit message when exiting (#1166)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
67255a5529
commit
9606f128e4
2 changed files with 8 additions and 0 deletions
|
@ -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>();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue