diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | history.c | 16 | ||||
-rw-r--r-- | history.h | 3 | ||||
-rw-r--r-- | main.c | 33 |
4 files changed, 47 insertions, 15 deletions
@@ -1,3 +1,11 @@ +2002-01-27 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 02914] + * history.c (copyHist): added + * history.h (copyHist): ditto + * main.c (goURL0): copyHist(URLHist), push current and anchor URLs + default set by DefaultURLString + 2002-01-26 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> * [w3m-dev 02913] wrong table width calculation @@ -2308,4 +2316,4 @@ * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.264 2002/01/25 17:25:44 ukai Exp $ +$Id: ChangeLog,v 1.265 2002/01/26 17:24:01 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: history.c,v 1.6 2001/12/10 17:02:44 ukai Exp $ */ +/* $Id: history.c,v 1.7 2002/01/26 17:24:01 ukai Exp $ */ #include "fm.h" #ifdef USE_HISTORY @@ -82,6 +82,20 @@ newHist() return hist; } +Hist * +copyHist(Hist *hist) +{ + Hist *new; + HistItem *item; + + if (hist == NULL) + return NULL; + new = newHist(); + for (item = hist->list->first; item; item = item->next) + pushHist(new, (char *)item->ptr); + return new; +} + HistItem * unshiftHist(Hist *hist, char *ptr) { @@ -1,4 +1,4 @@ -/* $Id: history.h,v 1.4 2001/12/10 17:02:44 ukai Exp $ */ +/* $Id: history.h,v 1.5 2002/01/26 17:24:01 ukai Exp $ */ #ifndef HISTORY_H #define HISTORY_H @@ -18,6 +18,7 @@ typedef struct { } Hist; extern Hist *newHist(); +extern Hist *copyHist(Hist *hist); extern HistItem *unshiftHist(Hist *hist, char *ptr); extern HistItem *pushHist(Hist *hist, char *ptr); extern HistItem *pushHashHist(Hist *hist, char *ptr); @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.72 2002/01/24 17:46:50 ukai Exp $ */ +/* $Id: main.c,v 1.73 2002/01/26 17:24:01 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -3621,19 +3621,28 @@ goURL0(char *prompt, int relative) url = searchKeyData(); if (url == NULL) { - if (DefaultURLString == DEFAULT_URL_CURRENT) { - current = baseURL(Currentbuf); - if (current) - url = parsedURL2Str(current)->ptr; + Hist *hist = copyHist(URLHist); + Anchor *a; + + current = baseURL(Currentbuf); + if (current) { + char *c_url = parsedURL2Str(current)->ptr; + if (DefaultURLString == DEFAULT_URL_CURRENT) + url = c_url; + else + pushHist(hist, c_url); } - else if (DefaultURLString == DEFAULT_URL_LINK) { - Anchor *a = retrieveCurrentAnchor(Currentbuf); - if (a) { - parseURL2(a->url, &p_url, baseURL(Currentbuf)); - url = parsedURL2Str(&p_url)->ptr; - } + a = retrieveCurrentAnchor(Currentbuf); + if (a) { + char *a_url; + parseURL2(a->url, &p_url, current); + a_url = parsedURL2Str(&p_url)->ptr; + if (DefaultURLString == DEFAULT_URL_LINK) + url = a_url; + else + pushHist(hist, a_url); } - url = inputLineHist(prompt, url, IN_URL, URLHist); + url = inputLineHist(prompt, url, IN_URL, hist); if (url != NULL) SKIP_BLANKS(url); } |