commit - 1b0e6efceb972ec76c7283d0a9e6f837425bd1fd
commit + bc55cdb9b8678689c6f39504ccf17cf1d0f943d5
blob - 3e64e6af109507e77600a49c5b8c434a59f6968b
blob + 46a9b460d3f3c93beb6740d499fcfadd415807cd
--- ChangeLog
+++ ChangeLog
+2021-08-12 Omar Polo <op@omarpolo.com>
+
+ * telescope.c (load_url): improved reload command: it doesn't push the current url to the history anymore.
+
2021-08-03 Omar Polo <op@omarpolo.com>
* pages/about_new.gmi.in: add link to veronica-2. reorder links
blob - c4e4801a051319e8e36bdd92f8b4c5b8909460e9
blob + 767741497ace904ea7b086af834965318b22d7fd
--- cmd.c
+++ cmd.c
switch (vl->parent->type) {
case LINE_LINK:
- load_url_in_tab(current_tab, vl->parent->alt, NULL);
+ load_url_in_tab(current_tab, vl->parent->alt, NULL, 0);
break;
case LINE_PRE_START:
l = TAILQ_NEXT(vl->parent, lines);
void
cmd_reload_page(struct buffer *buffer)
{
- load_url_in_tab(current_tab, current_tab->hist_cur->h, NULL);
+ load_url_in_tab(current_tab, current_tab->hist_cur->h, NULL, 1);
}
void
void
cmd_list_bookmarks(struct buffer *buffer)
{
- load_url_in_tab(current_tab, "about:bookmarks", NULL);
+ load_url_in_tab(current_tab, "about:bookmarks", NULL, 0);
}
void
blob - d411d634d08b25e5ef43f02b9860ef4345f436d3
blob + 98e0a90400e163cc52fefa931180c34ecfa8de3f
--- minibuffer.c
+++ minibuffer.c
memcpy(&uri, &tab->uri, sizeof(tab->uri));
phos_uri_set_query(&uri, ministate.buf);
phos_serialize_uri(&uri, buf, sizeof(buf));
- load_url_in_tab(tab, buf, NULL);
+ load_url_in_tab(tab, buf, NULL, 0);
}
void
{
exit_minibuffer();
minibuffer_hist_save_entry();
- load_url_in_tab(current_tab, ministate.buf, NULL);
+ load_url_in_tab(current_tab, ministate.buf, NULL, 0);
}
void
}
exit_minibuffer();
- load_url_in_tab(current_tab, l->alt, NULL);
+ load_url_in_tab(current_tab, l->alt, NULL, 0);
}
static inline void
blob - 615597265f0e43658496215a61fe82564857f9b7
blob + 0bf6e95212e5111ca64597b50810501f53237a9b
--- telescope.c
+++ telescope.c
* do load it!
*/
void
-load_url(struct tab *tab, const char *url, const char *base)
+load_url(struct tab *tab, const char *url, const char *base, int nohist)
{
int lazy;
tab->flags &= ~TAB_LAZY;
}
- if (!lazy || tab->hist_cur == NULL) {
+ /* can't have both nohist and lazy at the same time. */
+ if (nohist && lazy)
+ nohist = 0;
+
+ if (!nohist && (!lazy || tab->hist_cur == NULL)) {
if (tab->hist_cur != NULL)
hist_clear_forward(&tab->hist,
TAILQ_NEXT(tab->hist_cur, entries));
blob - 3e1f9768b8d9f56c3488a6bfa2bda2789d0c6e19
blob + d16801bd0a336a700fc3b24645b3bc0269ba511c
--- telescope.h
+++ telescope.h
/* telescope.c */
void gopher_send_search_req(struct tab *, const char *);
-void load_url(struct tab *, const char *, const char *);
+void load_url(struct tab *, const char *, const char *, int);
int load_previous_page(struct tab*);
int load_next_page(struct tab*);
void free_tab(struct tab *);
blob - e0bd2158c686645f62e455d8456a9991120eae78
blob + 2c550124b6532106073abc2987c978dc57e8a631
--- ui.c
+++ ui.c
}
void
-load_url_in_tab(struct tab *tab, const char *url, const char *base)
+load_url_in_tab(struct tab *tab, const char *url, const char *base, int nohist)
{
if (!operating) {
- load_url(tab, url, base);
+ load_url(tab, url, base, nohist);
return;
}
message("Loading %s...", url);
start_loading_anim(tab);
- load_url(tab, url, base);
+ load_url(tab, url, base, nohist);
redraw_tab(tab);
}
tab->flags &= ~TAB_URGENT;
if (operating && tab->flags & TAB_LAZY)
- load_url_in_tab(tab, tab->hist_cur->h, NULL);
+ load_url_in_tab(tab, tab->hist_cur->h, NULL, 0);
}
unsigned int
else
TAILQ_INSERT_TAIL(&tabshead, tab, tabs);
- load_url_in_tab(tab, url, base);
+ load_url_in_tab(tab, url, base, 0);
return tab;
}
blob - 02b2dd49988a6e2179550843d0adbc68170ccd23
blob + d043c8026f06fcfa44dd26e43e5abc4f11700f9e
--- ui.h
+++ ui.h
void global_key_unbound(void);
struct vline *adjust_line(struct vline *, struct buffer *);
void start_loading_anim(struct tab *);
-void load_url_in_tab(struct tab *, const char *, const char *);
+void load_url_in_tab(struct tab *, const char *, const char *, int);
void switch_to_tab(struct tab *);
struct buffer *current_buffer(void);
struct tab *new_tab(const char *, const char *base);