Browse Source

Fixes possible extra space in compact view

main
Eric Amodio 6 years ago
parent
commit
04a994a7d1
1 changed files with 17 additions and 3 deletions
  1. +17
    -3
      src/git/models/status.ts

+ 17
- 3
src/git/models/status.ts View File

@ -90,9 +90,23 @@ export class GitStatus {
return `${prefix}${status}${suffix}`;
}
return `${prefix}${compact && added === 0 ? '' : `+${added}${separator}`}${
compact && changed === 0 ? '' : `~${changed}${separator}`
}${compact && deleted === 0 ? '' : `-${deleted}`}${suffix}`;
let status = '';
if (compact) {
if (added !== 0) {
status += `+${added}`;
}
if (changed !== 0) {
status += `${status.length === 0 ? '' : separator}~${changed}`;
}
if (deleted !== 0) {
status += `${status.length === 0 ? '' : separator}-${deleted}`;
}
}
else {
status += `+${added}${separator}~${changed}${separator}-${deleted}`;
}
return `${prefix}${status}${suffix}`;
}
getUpstreamStatus(options: {

Loading…
Cancel
Save