summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-04-20 22:05:57 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-04-20 22:05:57 +0800
commit977f7677ac95fae772fd6fc3ceebc20ff5d5599d (patch)
tree40e9e53ce33b49580cbdc0ccc625de4506863356 /mbbsd
parentb9eee7301a59036c791b0cabef44092aaedc9c80 (diff)
downloadpttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.tar
pttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.tar.gz
pttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.tar.bz2
pttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.tar.lz
pttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.tar.xz
pttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.tar.zst
pttbbs-977f7677ac95fae772fd6fc3ceebc20ff5d5599d.zip
(edit) same bug to quote.
we should adjust (first) line if template files were read. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2703 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/edit.c7
-rw-r--r--mbbsd/othello.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 1a632325..db2fdea7 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -2440,8 +2440,10 @@ vedit(char *fpath, int saveheader, int *islocal)
oldcurrline = curr_buf->currline = curr_buf->top_of_win =
curr_buf->firstline = curr_buf->lastline = alloc_line(WRAPMARGIN);
- if (*fpath)
+ if (*fpath) {
read_file(fpath);
+ curr_buf->firstline = adjustline(curr_buf->firstline, WRAPMARGIN);
+ }
if (*quote_file) {
do_quote();
@@ -2450,6 +2452,9 @@ vedit(char *fpath, int saveheader, int *islocal)
}
/* No matter you quote or not, just start the cursor from (0,0) */
+ /* Warning! Because we moved line to first line, any buffer update
+ * must call adjustline for firstline. */
+
oldcurrline = curr_buf->currline = curr_buf->firstline;
curr_buf->currpnt = curr_buf->currln = curr_buf->curr_window_line = curr_buf->edit_margin = curr_buf->last_margin = 0;
diff --git a/mbbsd/othello.c b/mbbsd/othello.c
index 16739f7a..9431e7df 100644
--- a/mbbsd/othello.c
+++ b/mbbsd/othello.c
@@ -498,7 +498,7 @@ choose(void)
outs("(2) 嬰兒\n"); /* 想 3 步 */
outs("(3) 小孩\n"); /* 想 4 步 */
do {
- getdata(4, 0, "請選擇一個對象和您對打:(1~5)",
+ getdata(4, 0, "請選擇一個對象和您對打:(1~3)",
thinkstep, sizeof(thinkstep), LCECHO);
} while (thinkstep[0] < '1' || thinkstep[0] > '3');
clear();