commit - 0a5a10e89b303fbbe95fb2014d3453af65993b95
commit + dc5df781e91cacf1776473dad50da7a7e749d152
blob - 78d151f4dba52503568224e8c42654f315aba34d
blob + e709cac2efc709636a8779ee056ead5ce41ddc49
--- gemtext.c
+++ gemtext.c
if (len == 0)
return emit_line(p, t, NULL, NULL);
+ if (t == LINE_TITLE_1 && *p->title == '\0')
+ strncpy(p->title, buf, MIN(sizeof(p->title)-1, len));
+
if ((l = calloc(1, len+1)) == NULL)
return 0;
memcpy(l, buf, len);
blob - 6dcb8f235e8c26e0188846169cfb36cd4ea4a490
blob + 8bad95b2dfd0f9ddca765cb59044a608c8da203a
--- telescope.h
+++ telescope.h
#include "url.h"
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
#define GEMINI_URL_LEN 1024
enum imsg_type {
struct parser {
const char *name;
+ char title[32+1];
char *buf;
size_t len;
size_t cap;
blob - 38dc1c64aa048ff3a3dd0f5d471b6acfa5f1eeef
blob + 81d0afaea9e344f3135c1fa639428e11a2f09ade
--- ui.c
+++ ui.c
#define TAB_CURRENT 0x1
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-
struct minibuf_histhead;
static struct event stdioev, winchev;
{
struct tab *tab;
int current;
+ const char *title;
werase(tabline);
wbkgd(tabline, A_REVERSE);
TAILQ_FOREACH(tab, &tabshead, tabs) {
current = tab->flags & TAB_CURRENT;
+ if (*(title = tab->page.title) == '\0')
+ title = tab->urlstr;
+
if (current)
wattron(tabline, A_UNDERLINE);
- wprintw(tabline, "%s%d:todo title ",
- current ? "*" : " ", tab->id);
+ wprintw(tabline, "%s%d: %s",
+ current ? "*" : " ", tab->id, title);
if (current)
wattroff(tabline, A_UNDERLINE);