… | |
… | |
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 | { |
|
|
2662 | if (ch == C0_LF) |
2661 | nlines++; |
2663 | nlines++; |
|
|
2664 | |
2662 | refresh_count++; |
2665 | refresh_count++; |
2663 | |
2666 | |
2664 | if (!(options & Opt_jumpScroll) |
2667 | if (!(options & Opt_jumpScroll) |
2665 | || (refresh_count >= refresh_limit * (TermWin.nrow - 1))) |
2668 | || (refresh_count >= refresh_limit * (TermWin.nrow - 1))) |
2666 | { |
2669 | { |
… | |
… | |
2673 | if (nlines >= TermWin.nrow - 1) |
2676 | if (nlines >= TermWin.nrow - 1) |
2674 | { |
2677 | { |
2675 | scr_add_lines (buf, nlines, str - buf); |
2678 | scr_add_lines (buf, nlines, str - buf); |
2676 | nlines = 0; |
2679 | nlines = 0; |
2677 | str = buf; |
2680 | str = buf; |
|
|
2681 | eol = str + min (TermWin.ncol, UBUFSIZ); |
2678 | } |
2682 | } |
2679 | } |
|
|
2680 | |
2683 | |
2681 | if (str >= buf + UBUFSIZ) |
2684 | if (str >= eol) |
2682 | { |
2685 | { |
|
|
2686 | if (eol >= buf + UBUFSIZ) |
|
|
2687 | { |
2683 | ch = NOCHAR; |
2688 | ch = NOCHAR; |
2684 | break; |
2689 | break; |
|
|
2690 | } |
|
|
2691 | else |
|
|
2692 | eol = min (eol + TermWin.ncol, buf + UBUFSIZ); |
|
|
2693 | } |
|
|
2694 | |
2685 | } |
2695 | } |
2686 | |
2696 | |
2687 | seq_begin = cmdbuf_ptr; |
2697 | seq_begin = cmdbuf_ptr; |
2688 | ch = next_char (); |
2698 | ch = next_char (); |
2689 | } |
2699 | } |