--- ./LYForms.c-pre-goodleft Sun Oct 15 21:40:32 2000 +++ ./LYForms.c Thu Jan 18 20:20:42 2001 @@ -683,12 +683,12 @@ again: goto breakfor; #endif /* NOTDEFINED */ - /* + default: + /* [ 1999/04/14 (Wed) 15:01:33 ] * Left arrrow in column 0 deserves special treatment here, * else you can get trapped in a form without submit button! */ - case LTARROW: /* 1999/04/14 (Wed) 15:01:33 */ - if (MyEdit.pos == 0 && repeat == -1) { + if (action == LYE_BACK && MyEdit.pos == 0 && repeat == -1) { int c = YES; /* Go back immediately if no changes */ if (textfield_prompt_at_left_edge) { c = HTConfirmDefault(PREV_DOC_QUERY, NO); @@ -704,9 +704,6 @@ again: _statusline(ENTER_TEXT_ARROWS_OR_TAB); } } - /* fall through */ - - default: if (form->disabled == YES) { /* * Allow actions that don't modify the contents even @@ -744,7 +741,25 @@ again: if (rc < 0) { ch = -rc; - goto breakfor; + /* FORW_RL and BACK_LL may require special attention. + BACK_LL wanted to switch to the previous link on + the same line. However, if there is no such link, + then we would either disactivate the form + (with -tna), or will reenter the form, thus we jump + to the end of the line; both are counterintuitive. + Unfortunately, we do not have access to curdoc.link, + so we deduce it ourselves. We don't have the info + to do it inside LYLineEdit(). + This should work for prompts too. */ + if ( (action != LYE_BACK_LL && action != LYE_FORW_RL) + || ((form_link - links) >= 0 + && (form_link - links) < nlinks + && (action==LYE_FORW_RL + ? (form_link - links) < nlinks - 1 + : (form_link - links) > 0) + && form_link[action==LYE_FORW_RL ? 1 : -1].ly + == form_link->ly)) + goto breakfor; } #ifdef SUPPORT_MULTIBYTE_EDIT if (rc == 0) {