… | |
… | |
2646 | /* Read a text string from the input buffer */ |
2646 | /* Read a text string from the input buffer */ |
2647 | unicode_t buf[UBUFSIZ]; |
2647 | unicode_t buf[UBUFSIZ]; |
2648 | bool refreshnow = false; |
2648 | bool refreshnow = false; |
2649 | int nlines = 0; |
2649 | int nlines = 0; |
2650 | unicode_t *str = buf; |
2650 | unicode_t *str = buf; |
|
|
2651 | unicode_t *eol = str + min (TermWin.ncol, UBUFSIZ); |
2651 | |
2652 | |
2652 | for (;;) |
2653 | for (;;) |
2653 | { |
2654 | { |
2654 | if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)) |
2655 | if (ch == NOCHAR || (IS_CONTROL (ch) && ch != C0_LF && ch != C0_CR && ch != C0_HT)) |
2655 | break; |
2656 | break; |
2656 | |
2657 | |
2657 | *str++ = ch; |
2658 | *str++ = ch; |
2658 | |
2659 | |
2659 | if (ch == C0_LF) |
2660 | if (ch == C0_LF || str >= eol) |
2660 | { |
2661 | { |
2661 | nlines++; |
2662 | nlines++; |
2662 | refresh_count++; |
2663 | refresh_count++; |
2663 | |
2664 | |
2664 | if (!(options & Opt_jumpScroll) |
2665 | if (!(options & Opt_jumpScroll) |
… | |
… | |
2673 | if (nlines >= TermWin.nrow - 1) |
2674 | if (nlines >= TermWin.nrow - 1) |
2674 | { |
2675 | { |
2675 | scr_add_lines (buf, nlines, str - buf); |
2676 | scr_add_lines (buf, nlines, str - buf); |
2676 | nlines = 0; |
2677 | nlines = 0; |
2677 | str = buf; |
2678 | str = buf; |
|
|
2679 | eol = str + min (TermWin.ncol, UBUFSIZ); |
2678 | } |
2680 | } |
2679 | } |
|
|
2680 | |
2681 | |
2681 | if (str >= buf + UBUFSIZ) |
2682 | if (str >= eol) |
2682 | { |
2683 | { |
|
|
2684 | if (eol >= buf + UBUFSIZ) |
|
|
2685 | { |
2683 | ch = NOCHAR; |
2686 | ch = NOCHAR; |
2684 | break; |
2687 | break; |
|
|
2688 | } |
|
|
2689 | else |
|
|
2690 | eol = min (eol + TermWin.ncol, buf + UBUFSIZ); |
|
|
2691 | } |
|
|
2692 | |
2685 | } |
2693 | } |
2686 | |
2694 | |
2687 | seq_begin = cmdbuf_ptr; |
2695 | seq_begin = cmdbuf_ptr; |
2688 | ch = next_char (); |
2696 | ch = next_char (); |
2689 | } |
2697 | } |