mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-17 01:35:37 -05:00
Changes to use enum for glyphs
This commit is contained in:
@@ -56,6 +56,12 @@ export namespace Strings {
|
||||
}
|
||||
}
|
||||
|
||||
export function pad(s: string, before: number = 0, after: number = 0, padding: string = `\u00a0`) {
|
||||
if (before === 0 && after === 0) return s;
|
||||
|
||||
return `${before === 0 ? '' : padding.repeat(before)}${s}${after === 0 ? '' : padding.repeat(after)}`;
|
||||
}
|
||||
|
||||
export function padLeft(s: string, padTo: number, padding: string = '\u00a0') {
|
||||
const diff = padTo - s.length;
|
||||
return (diff <= 0) ? s : '\u00a0'.repeat(diff) + s;
|
||||
|
||||
Reference in New Issue
Block a user