about summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/ui.c b/ui.c
index da40dc0..9b55c83 100644
--- a/ui.c
+++ b/ui.c
@@ -236,13 +236,6 @@ static void errExit(void) {
 }
 
 void uiInitEarly(void) {
-	char buf[TimeCap];
-	struct tm *time = localtime(&(time_t) { -22100400 });
-	uiTime.width = strftime(buf, sizeof(buf), uiTime.format, time);
-	if (!uiTime.width) {
-		errx(EX_CONFIG, "invalid timestamp format: %s", uiTime.format);
-	}
-
 	initscr();
 	cbreak();
 	noecho();
@@ -264,6 +257,16 @@ void uiInitEarly(void) {
 	main = newwin(MAIN_LINES, COLS, StatusLines, 0);
 	if (!main) err(EX_OSERR, "newwin");
 
+	int y;
+	char buf[TimeCap];
+	struct tm *time = localtime(&(time_t) { -22100400 });
+	size_t len = strftime(buf, sizeof(buf), uiTime.format, time);
+	if (!len) errx(EX_CONFIG, "invalid timestamp format: %s", uiTime.format);
+	waddstr(main, buf);
+	waddch(main, ' ');
+	getyx(main, y, uiTime.width);
+	(void)y;
+
 	input = newpad(InputLines, InputCols);
 	if (!input) err(EX_OSERR, "newpad");
 	keypad(input, true);
@@ -476,8 +479,7 @@ static size_t windowBottom(const struct Window *window) {
 }
 
 static int windowCols(const struct Window *window) {
-	if (!window->time) return COLS;
-	return COLS - (uiTime.width + 1);
+	return COLS - (window->time ? uiTime.width : 0);
 }
 
 static void mainAdd(int y, bool time, const struct Line *line) {
@@ -498,8 +500,8 @@ static void mainAdd(int y, bool time, const struct Line *line) {
 		waddstr(main, buf);
 		waddch(main, ' ');
 	} else if (time) {
-		whline(main, ' ', uiTime.width + 1);
-		wmove(main, y, uiTime.width + 1);
+		whline(main, ' ', uiTime.width);
+		wmove(main, y, uiTime.width);
 	}
 	styleAdd(main, line->str);
 	getyx(main, ny, nx);
@@ -752,8 +754,8 @@ static void inputUpdate(void) {
 	int y, x;
 	wmove(input, 0, 0);
 	if (window->time && window->id != Network) {
-		whline(input, ' ', uiTime.width + 1);
-		wmove(input, 0, uiTime.width + 1);
+		whline(input, ' ', uiTime.width);
+		wmove(input, 0, uiTime.width);
 	}
 	wattr_set(input, styleAttr(stylePrompt), stylePair(stylePrompt), NULL);
 	waddstr(input, prefix);
/cgit-pink/commit/ui-tree.c?h=1.4.1&id=b4c3562f57c924866314d0f80f46dddecd4ce61a&follow=1'>Expose file extension in tree lists as class to allow nicer tree stylingMartin Szulecki 2009-08-08Introduce noplainemail option to hide email adresses from spambotsMartin Szulecki 2009-07-31ui-commit: add support for 'commit-filter' optionLars Hjemli 2009-07-31ui-tree: add support for source-filter optionLars Hjemli 2009-07-31ui-snapshot: use cgit_{open|close}_filter() to execute compressorsLars Hjemli 2009-07-31Add generic filter/plugin infrastructureLars Hjemli 2009-07-25Add support for mime type registration and lookupLars Hjemli 2009-07-25cgit.h: keep config flags sortedLars Hjemli 2009-07-25cgitrc.5.txt: document 'embedded' and 'noheader'Lars Hjemli 2009-07-25Add support for 'noheader' optionLars Hjemli 2009-07-25cgitrc.5.txt: document 'head-include'Lars Hjemli 2009-07-25ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli 2009-06-07Add head-include configuration option.Mark Lodato 2009-03-15CGIT 0.8.2.1Lars Hjemli 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli 2009-03-15fix segfault when displaying empty blobsEric Wong 2009-02-19Add support for HEAD requestsLars Hjemli 2009-02-19Add support for ETag in 'plain' viewLars Hjemli 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli 2009-02-12Makefile: add doc-related targetsLars Hjemli