- default:
- if (c >= ' ' && c != 0234) {
- if (wrapnext) {
- cpos[1] = ATTR_WRAPPED;
- if (curs_y == marg_b)
- scroll (marg_t, marg_b, 1, TRUE);
- else if (curs_y < rows-1)
- curs_y++;
- curs_x = 0;
- fix_cpos;
- wrapnext = FALSE;
- nl_count++;
- }
- if (insert)
- insch (1);
- check_selection (cpos, cpos+1);
- *cpos++ = xlat_tty2scr((unsigned char)c) | curr_attr |
- (c <= 0x7F ? cset_attr[cset] : ATTR_ASCII);
- curs_x++;
- if (curs_x == cols) {
- cpos--;
- curs_x--;
- wrapnext = wrap;
- }
- disptop = scrtop;
+ }
+ }
+ else switch (termstate) {
+ case TOPLEVEL:
+ if (c >= ' ' && c != 0234) {
+ if (wrapnext) {
+ cpos[1] = ATTR_WRAPPED;
+ if (curs_y == marg_b)
+ scroll (marg_t, marg_b, 1, TRUE);
+ else if (curs_y < rows-1)
+ curs_y++;
+ curs_x = 0;
+ fix_cpos;
+ wrapnext = FALSE;
+ nl_count++;
+ }
+ if (insert)
+ insch (1);
+ check_selection (cpos, cpos+1);
+ *cpos++ = xlat_tty2scr((unsigned char)c) | curr_attr |
+ (c <= 0x7F ? cset_attr[cset] : ATTR_ASCII);
+ curs_x++;
+ if (curs_x == cols) {
+ cpos--;
+ curs_x--;
+ wrapnext = wrap;