Add space to git-prompt between branch & remote diff
This commit is contained in:
@@ -123,8 +123,9 @@ int main() {
|
|||||||
remote, "/", branch, "...HEAD --count"));
|
remote, "/", branch, "...HEAD --count"));
|
||||||
char count[32] = {};
|
char count[32] = {};
|
||||||
fread(count, 1, sizeof(count), process.out);
|
fread(count, 1, sizeof(count), process.out);
|
||||||
if (process_close(process) == 0 && strcmp("0", trim(count))) {
|
int ahead = process_close(process) == 0 && strcmp("0", trim(count));
|
||||||
append(prompt, 2, "↑", trim(count));
|
if (ahead) {
|
||||||
|
append(prompt, 2, " ↑", trim(count));
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the number of commits behind the remote
|
// get the number of commits behind the remote
|
||||||
@@ -135,7 +136,7 @@ int main() {
|
|||||||
memset(count, 0, sizeof(count));
|
memset(count, 0, sizeof(count));
|
||||||
fread(count, 1, sizeof(count), process.out);
|
fread(count, 1, sizeof(count), process.out);
|
||||||
if (process_close(process) == 0 && strcmp("0", trim(count))) {
|
if (process_close(process) == 0 && strcmp("0", trim(count))) {
|
||||||
append(prompt, 2, "↓", trim(count));
|
append(prompt, 2, ahead ? "↓" : " ↓", trim(count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
append(prompt, 1, " ");
|
append(prompt, 1, " ");
|
||||||
|
|||||||
Reference in New Issue
Block a user