From e11699c2e958f1c008547030edc6a9bd0f7bbc82 Mon Sep 17 00:00:00 2001 From: Yong Bakos Date: Tue, 16 Aug 2016 10:55:09 -0700 Subject: [PATCH 1/3] list: Add trailing line break. --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 339dd42..4bc9cbe 100644 --- a/main.c +++ b/main.c @@ -20,7 +20,7 @@ #include "version.h" #include "cg_utils.h" - + // Number of modes to list per line. #define MODES_PER_LINE 3 @@ -154,7 +154,7 @@ unsigned int listAvailableModes(CGDirectDisplayID display, int displayNum) { CFRangeMake(0, CFArrayGetCount(allModesSorted)), (CFComparatorFunction) _compareCFDisplayModes, NULL - ); + ); #ifndef LIST_DEBUG if(displayNum != 0) @@ -225,7 +225,7 @@ unsigned int listAvailableModes(CGDirectDisplayID display, int displayNum) { ioflags & kDisplayModeValidForMirroringFlag ?1:0 ); #endif } - + printf("\n"); CFRelease(allModes); CFRelease(allModesSorted); From 8f87203f3b8c42d9e7841afb21dc0e4a68519d17 Mon Sep 17 00:00:00 2001 From: Yong Bakos Date: Tue, 16 Aug 2016 11:22:16 -0700 Subject: [PATCH 2/3] list: Add trailing line break. Executing `screenresolution list` can result in the command prompt being displayed immediately after the last resolution in the list. Add a trailing line break so the command prompt is displayed on a new line. --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 4bc9cbe..8fb709a 100644 --- a/main.c +++ b/main.c @@ -225,7 +225,10 @@ unsigned int listAvailableModes(CGDirectDisplayID display, int displayNum) { ioflags & kDisplayModeValidForMirroringFlag ?1:0 ); #endif } - printf("\n"); + + if (numModes % MODES_PER_LINE) + printf("\n"); + CFRelease(allModes); CFRelease(allModesSorted); From 1dcdebda159c82710425744576e4f068f28aeb8c Mon Sep 17 00:00:00 2001 From: Yong Bakos Date: Tue, 16 Aug 2016 11:26:29 -0700 Subject: [PATCH 3/3] Add ignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..206fba7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +version.h +*.o