summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-16 10:18:21 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-16 10:18:21 +0800
commit7ded7e3cd2c429bae15373783c71990f83ea9bc5 (patch)
tree1c41c4bec414a5eabacc62a8dc45b4d03a1adb1c /mbbsd/edit.c
parent42e7d7835361b5a07dadce5192af33585acbd578 (diff)
downloadpttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.tar
pttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.tar.gz
pttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.tar.bz2
pttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.tar.lz
pttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.tar.xz
pttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.tar.zst
pttbbs-7ded7e3cd2c429bae15373783c71990f83ea9bc5.zip
fix KEY_END's bug in ansimode
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2514 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r--mbbsd/edit.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index ba012085..b14b2c3a 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -2431,7 +2431,7 @@ int
vedit(char *fpath, int saveheader, int *islocal)
{
char last = 0; /* the last key you press */
- int ch, ret;
+ int ch, tmp;
int mode0 = currutmp->mode;
int destuid0 = currutmp->destuid;
@@ -2577,16 +2577,16 @@ vedit(char *fpath, int saveheader, int *islocal)
switch (ch) {
case Ctrl('X'): /* Save and exit */
- ret = write_file(fpath, saveheader, islocal);
- if (ret != KEEP_EDITING) {
+ tmp = write_file(fpath, saveheader, islocal);
+ if (tmp != KEEP_EDITING) {
currutmp->mode = mode0;
currutmp->destuid = destuid0;
exit_edit_buffer();
- if (!ret)
+ if (!tmp)
return money;
else
- return ret;
+ return tmp;
}
curr_buf->redraw_everything = YEA;
break;
@@ -3000,10 +3000,16 @@ vedit(char *fpath, int saveheader, int *islocal)
window_scroll_up();
}
}
- if (curr_buf->currpnt < t_columns - 1)
+
+ if (curr_buf->ansimode)
+ tmp = n2ansi(curr_buf->currpnt, curr_buf->currline);
+ else
+ tmp = curr_buf->currpnt;
+
+ if (tmp < t_columns - 1)
curr_buf->edit_margin = 0;
else
- curr_buf->edit_margin = curr_buf->currpnt / (t_columns - 8) * (t_columns - 8);
+ curr_buf->edit_margin = tmp / (t_columns - 8) * (t_columns - 8);
if (!curr_buf->redraw_everything) {
if (curr_buf->edit_margin != curr_buf->last_margin) {