summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r--mbbsd/edit.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 34ab3488..9efa6a27 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -133,32 +133,20 @@ indigestion(int i)
fprintf(stderr, "ÄY­«¤º¶Ë %d\n", i);
}
-void init_edit_buffer(editor_internal_t *buf)
+static void init_edit_buffer(editor_internal_t *buf)
{
- buf->firstline = NULL;
- buf->lastline = NULL;
- buf->currline = NULL;
- buf->blockline = NULL;
- buf->top_of_win = NULL;
- buf->deleted_lines = NULL;
-
- buf->insert_character = 1;
- buf->redraw_everything = 1;
- buf->indent_mode = 0;
- buf->line_dirty = 0;
- buf->currpnt = 0;
- buf->totaln = 0;
- buf->my_ansimode = 0;
- buf->phone_mode = 0;
- buf->phone_mode0 = 0;
+ /* all unspecified columns are 0 */
buf->blockln = -1;
buf->insert_c = ' ';
+ buf->insert_character = 1;
+ buf->redraw_everything = 1;
}
static void enter_edit_buffer(void)
{
editor_internal_t *p = curr_buf;
curr_buf = (editor_internal_t *)malloc(sizeof(editor_internal_t));
+ memset(curr_buf, 0, sizeof(editor_internal_t));
curr_buf->prev = p;
}
@@ -1806,6 +1794,8 @@ vedit(char *fpath, int saveheader, int *islocal)
if (quote_file[79] == 'L')
local_article = 1;
}
+
+ // No matter you quote or not, just start from (0,0)
curr_buf->currline = curr_buf->firstline;
curr_buf->currpnt = curr_buf->currln = curr_buf->curr_window_line = curr_buf->edit_margin = last_margin = 0;