commit 454da250d63e289c9f870fdaa85ac08fa74bd66c
parent 6804ae0c0351eda88f5ffa379367c22c049ac23b
Author: ukai <ukai>
Date: Sat, 26 Oct 2002 08:10:43 +0000
[w3m-dev-en 00783] hsaka@mth.biglobe.ne.jp (Hironori SAKAMOTO)
add display_lineinfo option
* display.c (displayBuffer): check displayLineInfo
* fm.h (displayLineInfo): added
* rc.c (CMT_DISPLINEINFO): added
(display_lineinfo): added
* NEWS (rc: display_lineinfo): add
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
5 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,15 @@
2002-10-26 Fumitoshi UKAI <ukai@debian.or.jp>
+ * [w3m-dev-en 00783] hsaka@mth.biglobe.ne.jp (Hironori SAKAMOTO)
+ add display_lineinfo option
+ * display.c (displayBuffer): check displayLineInfo
+ * fm.h (displayLineInfo): added
+ * rc.c (CMT_DISPLINEINFO): added
+ (display_lineinfo): added
+ * NEWS (rc: display_lineinfo): add
+
+2002-10-26 Fumitoshi UKAI <ukai@debian.or.jp>
+
* [w3m-dev-en 00781] "Clemens Fischer" <ino-waiting@gmx.net>
zope doesn't recognize implied *LWS in accept-language
* rc.c (sync_with_option): remove optional LWS
diff --git a/NEWS b/NEWS
@@ -1,5 +1,6 @@
-w3m 0.4?
+w3m 0.3.2 (release candidate)
+* rc: display_lineinfo: display current line number
* rc: passwd_file: passwd file for HTTP auth
* func: MARK_WORD
* rc: imgsize: obsoleted
diff --git a/display.c b/display.c
@@ -318,13 +318,14 @@ displayBuffer(Buffer *buf, int mode)
else
#endif /* not USE_MOUSE */
msg = Strnew();
- Strcat_charp(msg, "Viewing");
- if (buf->currentLine != NULL && buf->lastLine != NULL)
- Strcat(msg, Sprintf(" %3d%%",
- (int)((double)buf->currentLine->real_linenumber
- * 100.0 /
- (double)buf->lastLine->real_linenumber
- + 0.5)));
+ if (displayLineInfo && buf->currentLine != NULL && buf->lastLine != NULL) {
+ int cl = buf->currentLine->real_linenumber;
+ int ll = buf->lastLine->real_linenumber;
+ int r = (int)((double)cl * 100.0 / (double)ll + 0.5);
+ Strcat(msg, Sprintf("%d/%d (%3d%%)", cl, ll, r));
+ }
+ else
+ Strcat_charp(msg, "Viewing");
#ifdef USE_SSL
if (buf->ssl_certificate)
Strcat_charp(msg, "[SSL]");
diff --git a/fm.h b/fm.h
@@ -817,6 +817,7 @@ global int nextpage_topline init(FALSE);
#endif
global char *displayTitleTerm init(NULL);
global int displayLink init(FALSE);
+global int displayLineInfo init(FALSE);
global int retryAsHttp init(TRUE);
global int showLineNum init(FALSE);
global int show_srch_str init(TRUE);
diff --git a/rc.c b/rc.c
@@ -66,6 +66,7 @@ static char *config_file = NULL;
#define CMT_ARGV_IS_URL "scheme のない引数も URL とみなす"
#define CMT_TSELF "targetが未指定の場合に_selfを使用する"
#define CMT_DISPLINK "リンク先の自動表示"
+#define CMT_DISPLINEINFO "現在の行番号の表示"
#ifdef USE_IMAGE
#define CMT_DISP_IMAGE "インライン画像を表示"
#define CMT_AUTO_IMAGE "インライン画像を自動で読み込む"
@@ -208,6 +209,7 @@ static char *config_file = NULL;
#define CMT_ARGV_IS_URL "Treat argument without scheme as URL"
#define CMT_TSELF "Use _self as default target"
#define CMT_DISPLINK "Display link URL automatically"
+#define CMT_DISPLINEINFO "Display current line number"
#ifdef USE_IMAGE
#define CMT_DISP_IMAGE "Display inline images"
#define CMT_AUTO_IMAGE "Load inline images automatically"
@@ -465,6 +467,8 @@ struct param_ptr params1[] = {
{"target_self", P_CHARINT, PI_ONOFF, (void *)&TargetSelf, CMT_TSELF, NULL},
{"display_link", P_INT, PI_ONOFF, (void *)&displayLink, CMT_DISPLINK,
NULL},
+ {"display_lineinfo", P_INT, PI_ONOFF, (void *)&displayLineInfo,
+ CMT_DISPLINEINFO, NULL},
{"ext_dirlist", P_INT, PI_ONOFF, (void *)&UseExternalDirBuffer,
CMT_EXT_DIRLIST, NULL},
{"dirlist_cmd", P_STRING, PI_TEXT, (void *)&DirBufferCommand,