Skip to content

Commit

Permalink
Merge pull request #8805 from pmiossec/more_message_templates
Browse files Browse the repository at this point in the history
Increase the number of commit templates
  • Loading branch information
RussKie committed Jan 30, 2021
2 parents 19a310e + 273f7a7 commit 53e88d1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion GitUI/CommandsDialogs/CommitDialog/FormCommitTemplateSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class FormCommitTemplateSettings : GitExtensionsForm

private CommitTemplateItem[] _commitTemplates;

private const int _maxCommitTemplates = 5;
private const int _maxCommitTemplates = 10;
private const int _maxShownCharsForName = 50;
private const int _maxUsedCharsForName = 80;

Expand Down Expand Up @@ -43,6 +43,16 @@ private void LoadSettings()
_commitTemplates[i] = new CommitTemplateItem();
}
}
else if (_commitTemplates.Length < _maxCommitTemplates)
{
// Migration: keep the one configured and complete with empty ones
var previousCommitTemplates = _commitTemplates;
_commitTemplates = new CommitTemplateItem[_maxCommitTemplates];
for (int i = 0; i < _commitTemplates.Length; i++)
{
_commitTemplates[i] = i < previousCommitTemplates.Length ? previousCommitTemplates[i] : new CommitTemplateItem();
}
}

_NO_TRANSLATE_comboBoxCommitTemplates.Items.Clear();

Expand Down

0 comments on commit 53e88d1

Please sign in to comment.