File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ class GitBlameInformationCache {
144
144
}
145
145
146
146
export class GitBlameController {
147
+ private readonly _subjectMaxLength = 50 ;
148
+
147
149
private readonly _onDidChangeBlameInformation = new EventEmitter < TextEditor > ( ) ;
148
150
public readonly onDidChangeBlameInformation = this . _onDidChangeBlameInformation . event ;
149
151
@@ -169,10 +171,14 @@ export class GitBlameController {
169
171
}
170
172
171
173
formatBlameInformationMessage ( template : string , blameInformation : BlameInformation ) : string {
174
+ const subject = blameInformation . subject && blameInformation . subject . length > this . _subjectMaxLength
175
+ ? `${ blameInformation . subject . substring ( 0 , this . _subjectMaxLength ) } \u2026`
176
+ : blameInformation . subject ;
177
+
172
178
const templateTokens = {
173
179
hash : blameInformation . hash ,
174
180
hashShort : blameInformation . hash . substring ( 0 , 8 ) ,
175
- subject : emojify ( blameInformation . subject ?? '' ) ,
181
+ subject : emojify ( subject ?? '' ) ,
176
182
authorName : blameInformation . authorName ?? '' ,
177
183
authorEmail : blameInformation . authorEmail ?? '' ,
178
184
authorDate : new Date ( blameInformation . authorDate ?? new Date ( ) ) . toLocaleString ( ) ,
You can’t perform that action at this time.
0 commit comments