mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04: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;
|
set;
|
||||||
} = 0;
|
} = 0;
|
||||||
|
|
||||||
|
public string LastCommitMessage
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = string.Empty;
|
||||||
|
|
||||||
public Dictionary<string, FilterMode> CollectHistoriesFilters()
|
public Dictionary<string, FilterMode> CollectHistoriesFilters()
|
||||||
{
|
{
|
||||||
var map = new Dictionary<string, FilterMode>();
|
var map = new Dictionary<string, FilterMode>();
|
||||||
|
|
|
@ -464,6 +464,7 @@ namespace SourceGit.ViewModels
|
||||||
_selectedView = _histories;
|
_selectedView = _histories;
|
||||||
_selectedViewIndex = 0;
|
_selectedViewIndex = 0;
|
||||||
|
|
||||||
|
_workingCopy.CommitMessage = _settings.LastCommitMessage;
|
||||||
_autoFetchTimer = new Timer(AutoFetchImpl, null, 5000, 5000);
|
_autoFetchTimer = new Timer(AutoFetchImpl, null, 5000, 5000);
|
||||||
RefreshAll();
|
RefreshAll();
|
||||||
}
|
}
|
||||||
|
@ -471,6 +472,7 @@ namespace SourceGit.ViewModels
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
SelectedView = null; // Do NOT modify. Used to remove exists widgets for GC.Collect
|
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);
|
var settingsSerialized = JsonSerializer.Serialize(_settings, JsonCodeGen.Default.RepositorySettings);
|
||||||
try
|
try
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue