Skip to content

Commit e97ec48

Browse files
authored
🐞 fix(extension.ts + commit-details.ts): git issue 72 (#73)
1 parent e51384f commit e97ec48

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/config/commit-detail.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export interface CommitDetailType extends QuickPickItem {
99
isEdit?: boolean;
1010
}
1111
//最大的 subject 限制字数 Max subject words
12-
export const MaxSubjectWords =
13-
workspace.getConfiguration('GitCommitPlugin').get<boolean>('MaxSubjectWords') || 20;
12+
export const MaxSubjectCharacters =
13+
workspace.getConfiguration('GitCommitPlugin').get<boolean>('MaxSubjectCharacters') || 20;
1414

1515
export function GetCommitDetailType() {
1616
const CommitDetailType: Array<CommitDetailType> = [
@@ -27,7 +27,7 @@ export function GetCommitDetailType() {
2727
description: localize('extension.commitDetailType.subject.description'),
2828
detail: localize(
2929
'extension.commitDetailType.subject.detail',
30-
MaxSubjectWords.toString(),
30+
MaxSubjectCharacters.toString(),
3131
),
3232
isEdit: false,
3333
},

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import GetCommitTypes, { CommitType } from './config/commit-type';
66
import {
77
GetCommitDetailType,
88
CommitDetailQuickPickOptions,
9-
MaxSubjectWords,
9+
MaxSubjectCharacters,
1010
CommitDetailType,
1111
} from './config/commit-detail';
1212
import GetCommitInputType, { CommitInputType } from './config/commit-input';
@@ -114,9 +114,9 @@ export function activate(context: vscode.ExtensionContext) {
114114
_detailType && (_detailType.isEdit = true);
115115
if (_key === 'subject') {
116116
const input_value_length = value ? value?.length : 0;
117-
if (input_value_length > MaxSubjectWords) {
117+
if (input_value_length > MaxSubjectCharacters) {
118118
vscode.window.showErrorMessage(
119-
`The commit overview is no more than ${MaxSubjectWords} words but the current input is ${input_value_length} words`,
119+
`The commit overview is no more than ${MaxSubjectCharacters} characters but the current input is ${input_value_length} characters`,
120120
...['ok'],
121121
);
122122
inputMessageDetail(_key);

0 commit comments

Comments
 (0)