if (HTCJK == NOCJK && LYlowest_eightbit[current_char_set] > 0x97) return(ch);
if (HTCJK == NOCJK && LYlowest_eightbit[current_char_set] > 0x97) return(ch);  #endif
PUBLIC int LYEdit1 ARGS4(	EDREC *,	edit,	int,		ch,	int,		action,	BOOL,		maxMessage){   /* returns 0    character processed     *         ch   otherwise     */    int i;    int length;#ifdef EXP_KEYBOARD_LAYOUT    static int map_active = 0;#endif    if (MaxLen <= 0)	return(0); /* Be defensive */    length = strlen(&Buf[0]);    StrLen = length;    switch (action) {#ifdef EXP_KEYBOARD_LAYOUT    case LYE_SWMAP:	/*	 *  Turn input character mapping on or off.	 */	map_active = ~map_active;	break;#endif    case LYE_AIX:	/*	 *  Hex 97.	 *  Fall through as a character for CJK, or if this is a valid	 *  character in the current display character set.	 *  Otherwise, we treat this as LYE_ENTER.	 */	 if (HTCJK == NOCJK && LYlowest_eightbit[current_char_set] > 0x97)	     return(ch);    case LYE_CHAR:#ifdef EXP_KEYBOARD_LAYOUT	if (map_active && ch < 128 && ch >= 0 &&	    LYKbLayouts[current_layout][ch])	    ch = UCTransUniChar((long) LYKbLayouts[current_layout][ch],		current_char_set);#endif	/*	 *  ch is printable or ISO-8859-1 escape character.	 */	if (Pos <= (MaxLen) && StrLen < (MaxLen)) {	    for(i = length; i >= Pos; i--)    /* Make room */		Buf[i+1] = Buf[i];	    Buf[length+1]='\0';	    Buf[Pos] = (unsigned char) ch;	    Pos++;	} else if (maxMessage) {	    _statusline(MAXLEN_REACHED_DEL_OR_MOV);	}	break;    case LYE_BACKW:	/*	 *  Backword.	 *  Definition of word is very naive: 1 or more a/n characters.	 */	while (Pos && !isalnum(Buf[Pos-1]))	    Pos--;	while (Pos &&  isalnum(Buf[Pos-1]))	    Pos--;	break;    case LYE_FORWW:	/*	 *  Word forward.	 */	while (isalnum(Buf[Pos]))	    Pos++;   /* '\0' is not a/n */	while (!isalnum(Buf[Pos]) && Buf[Pos])	    Pos++ ;	break;    case LYE_ERASE:	/*	 *  Erase the line to start fresh.	 */	 Buf[0] = '\0';	 /* fall through */    case LYE_BOL:	/*	 *  Go to first column.	 */	Pos = 0;	break;    case LYE_EOL:	/*	 *  Go to last column.	 */	Pos = length;	break;    case LYE_DELNW:	/*	 *  Delete next word.	 */	{	    int pos0 = Pos;	    LYEdit1 (edit, 0, LYE_FORWW, FALSE);	    while (Pos > pos0)		LYEdit1(edit, 0, LYE_DELP, FALSE);	}	break;    case LYE_DELPW:	/*	 *  Delete previous word.	 */	{	    int pos0 = Pos;	    LYEdit1 (edit, 0, LYE_BACKW, FALSE);	    pos0 -= Pos;	    while (pos0--)		LYEdit1(edit, 0, LYE_DELN, FALSE);	}	break;    case LYE_DELBL:	/*	 *  Delete from current cursor position back to BOL.	 */	{	    int pos0 = Pos;	    while (pos0--)		LYEdit1(edit, 0, LYE_DELP, FALSE);	}	break;    case LYE_DELEL:	/*	 *  Delete from current cursor position thru EOL.	 */	{	    int pos0 = Pos;	    LYEdit1(edit, 0, LYE_EOL, FALSE);	    pos0 = Pos - pos0;	    while (pos0--)		LYEdit1(edit, 0, LYE_DELP, FALSE);	}	break;    case LYE_DELN:	/*	 *  Delete next character (I-beam style cursor), or current	 *  character (box/underline style cursor).	 */	if (Pos >= length)	    break;	Pos++;	/* fall through - DO NOT RELOCATE the LYE_DELN case wrt LYE_DELP */    case LYE_DELP:	/*	 *  Delete preceding character.	 */	if (length == 0 || Pos == 0)	    break;	Pos--;	for (i = Pos; i < length; i++)	    Buf[i] = Buf[i+1];	i--;	Buf[i] = 0;	break;    case LYE_FORW:	/*	 *  Move cursor to the right.	 */	if (Pos < length)	    Pos++;	break;    case LYE_BACK:	/*	 *  Left-arrow move cursor to the left.	 */	if (Pos > 0)	    Pos--;	break;    case LYE_UPPER:	LYUpperCase(Buf);	break;    case LYE_LOWER:	LYLowerCase(Buf);	break;    default:	return(ch);    }    edit->dirty = TRUE;    StrLen = strlen(&Buf[0]);    return(0);}