basic: move some global variables

- move up_down_last_x to an EditState member
- make single_window static in qe.c
- move user_option to the QEmacsState structure
- move minibuffer and completion state to a MinibufState structure
- remove static state in do_minibuffer_exit
- add key name: LB for `{`, RB for `}` and VB for `|`
This commit is contained in:
Charlie Gordon 2017-04-16 17:31:14 +00:00
commit abe81df0b2
4 changed files with 78 additions and 76 deletions

10
html.c
View file

@ -503,8 +503,6 @@ static int up_down_func(void *opaque, CSSBox *box, int x, int y)
return 0;
}
static int up_down_last_x = -1;
static void html_move_up_down1(EditState *s, int dir, int xtarget)
{
HTMLState *hs;
@ -522,8 +520,8 @@ static void html_move_up_down1(EditState *s, int dir, int xtarget)
/* compute the position to which we would like to go */
if (xtarget == 0) {
if (up_down_last_x == -1)
up_down_last_x = cursor_pos.x1;
if (s->up_down_last_x == -1)
s->up_down_last_x = cursor_pos.x1;
}
if (dir > 0)
@ -533,7 +531,7 @@ static void html_move_up_down1(EditState *s, int dir, int xtarget)
/* find a suitable box upward or downward */
if (xtarget == 0) {
m->xd = up_down_last_x;
m->xd = s->up_down_last_x;
} else {
m->xd = xtarget;
}
@ -566,7 +564,7 @@ static void html_move_up_down(EditState *s, int dir)
return;
if (s->qe_state->last_cmd_func != (CmdFunc)do_up_down)
up_down_last_x = -1;
s->up_down_last_x = -1;
html_move_up_down1(s, dir, 0);
}