aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--main.c25
2 files changed, 30 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 60d8305..f1b2e5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-02-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03782] real linenumber for EDIT and EDIT_SCREEN
+ * main.c (cur_real_linenumber): added
+ (editBf): use cur_real_linenumber instead of CUR_LINENUMBER
+ (editScr): ditto
+
+2003-02-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03781] Debian Bug report logs - #181897: w3m submits query urls with "extra"
* main.c (_followForm): remove tailling '?'
@@ -7256,4 +7263,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.765 2003/02/25 16:01:38 ukai Exp $
+$Id: ChangeLog,v 1.766 2003/02/25 16:05:43 ukai Exp $
diff --git a/main.c b/main.c
index 9a7582a..57e7ce4 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.212 2003/02/25 16:01:41 ukai Exp $ */
+/* $Id: main.c,v 1.213 2003/02/25 16:05:48 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -2500,6 +2500,23 @@ linend(void)
displayBuffer(Currentbuf, B_NORMAL);
}
+static int
+cur_real_linenumber(Buffer *buf)
+{
+ Line *l, *cur = buf->currentLine;
+ int n;
+
+ if (!cur)
+ return 1;
+ n = cur->real_linenumber ? cur->real_linenumber : 1;
+ for (l = buf->firstLine; l && l != cur && l->real_linenumber == 0;
+ l = l->next) { /* header */
+ if (l->bpos == 0)
+ n++;
+ }
+ return n;
+}
+
/* Run editor on the current buffer */
void
editBf(void)
@@ -2518,7 +2535,8 @@ editBf(void)
cmd = unquote_mailcap(Currentbuf->edit, Currentbuf->real_type, fn,
checkHeader(Currentbuf, "Content-Type:"), NULL);
else
- cmd = myEditor(Editor, shell_quote(fn), CUR_LINENUMBER(Currentbuf));
+ cmd = myEditor(Editor, shell_quote(fn),
+ cur_real_linenumber(Currentbuf));
fmTerm();
system(cmd->ptr);
fmInit();
@@ -2543,7 +2561,8 @@ editScr(void)
saveBuffer(Currentbuf, f, TRUE);
fclose(f);
fmTerm();
- system(myEditor(Editor, tmpf, CUR_LINENUMBER(Currentbuf))->ptr);
+ system(myEditor(Editor, shell_quote(tmpf),
+ cur_real_linenumber(Currentbuf))->ptr);
fmInit();
unlink(tmpf);
displayBuffer(Currentbuf, B_FORCE_REDRAW);