Added emacs ^A,^E,^B & ^F keybindings to field editor.

Changed a constant to a sizeof in test.c
This commit is contained in:
Paul Richards 1995-01-11 06:08:45 +00:00
parent 49b95be03e
commit f4ae9090f4
2 changed files with 7 additions and 7 deletions

View File

@ -35,7 +35,7 @@ main()
struct text_field field4 = {string4};
struct input_field field5 = {1,"A place filler",0};
struct text_field field6 = {string6};
struct menu_field field7 = {4, 0, options7};
struct menu_field field7 = {sizeof &options7, 0, options7};
struct action_field field8 = {"EXIT",&exit_form};
struct action_field field9 = {"CANCEL",&cancel_form};

View File

@ -101,6 +101,8 @@ int
update_form(struct form *form)
{
show_form(form);
switch (form->field[form->current_field].type) {
case F_MENU:
field_menu(form);
@ -115,8 +117,6 @@ update_form(struct form *form)
default:
}
show_form(form);
return (done);
}
@ -379,11 +379,11 @@ field_input(struct form *form)
if (field->field.input->lbl_flag) {
field->field.input->lbl_flag = 0;
}
if (ch == F_CHOME) {
if ((ch == F_CHOME) || (ch == '')) {
disp_off = 0;
cursor = 0;
abspos = 0;
} else if (ch == F_CEND) {
} else if ((ch == F_CEND) || (ch == '')) {
disp_off = DISPOFF;
abspos = len;
cursor = CURSPOS;
@ -396,7 +396,7 @@ field_input(struct form *form)
len - abspos);
--len;
}
} else if ((ch == F_CLEFT) || (ch == F_CBS)) {
} else if ((ch == F_CLEFT) || (ch == F_CBS) || (ch == '')) {
if (!abspos)
beep();
else {
@ -413,7 +413,7 @@ field_input(struct form *form)
++cursor;
}
}
} else if (ch == F_CRIGHT) {
} else if ((ch == F_CRIGHT) || (ch == '')) {
if (abspos == len)
beep();
else {