comparison src/xdisp.c @ 21280:82fbf42bb989

(redisplay_window): Give byte position to FETCH_BYTE. Call pos_tab_offset appropriately. (try_window_id): Give byte position to FETCH_BYTE. Set val.bytepos to pos_byte.
author Kenichi Handa <handa@m17n.org>
date Wed, 25 Mar 1998 10:45:59 +0000
parents 50929073a0ba
children 2601d6057ec6
comparison
equal deleted inserted replaced
21279:9d5cc9392151 21280:82fbf42bb989
2319 get too much overlap, so change to the usual amount. */ 2319 get too much overlap, so change to the usual amount. */
2320 || pos.bufpos < startp + width / 2) 2320 || pos.bufpos < startp + width / 2)
2321 && PT > BEGV + minibuffer_scroll_overlap 2321 && PT > BEGV + minibuffer_scroll_overlap
2322 /* If we scrolled to an actual line boundary, 2322 /* If we scrolled to an actual line boundary,
2323 that's different; don't ignore line boundaries. */ 2323 that's different; don't ignore line boundaries. */
2324 && FETCH_BYTE (pos.bufpos - 1) != '\n') 2324 && FETCH_BYTE (pos.bytepos - 1) != '\n')
2325 { 2325 {
2326 pos.bufpos = PT - minibuffer_scroll_overlap; 2326 pos.bufpos = PT - minibuffer_scroll_overlap;
2327 pos.bytepos = CHAR_TO_BYTE (pos.bufpos); 2327 pos.bytepos = CHAR_TO_BYTE (pos.bufpos);
2328 } 2328 }
2329 2329
2635 /* Also, if changes reach all the way until ep.bufpos, 2635 /* Also, if changes reach all the way until ep.bufpos,
2636 it is possible that something was deleted after the 2636 it is possible that something was deleted after the
2637 newline before it, so the following line must be redrawn. */ 2637 newline before it, so the following line must be redrawn. */
2638 if (stop_vpos == ep.vpos 2638 if (stop_vpos == ep.vpos
2639 && (ep.bufpos == BEGV 2639 && (ep.bufpos == BEGV
2640 || FETCH_BYTE (ep.bufpos - 1) != '\n' 2640 || FETCH_BYTE (ep.bytepos - 1) != '\n'
2641 || ep.bufpos == Z - end_unchanged)) 2641 || ep.bufpos == Z - end_unchanged))
2642 stop_vpos = ep.vpos + 1; 2642 stop_vpos = ep.vpos + 1;
2643 2643
2644 cursor_vpos = -1; 2644 cursor_vpos = -1;
2645 overlay_arrow_seen = 0; 2645 overlay_arrow_seen = 0;
2659 width, hscroll, ep.tab_offset, w); 2659 width, hscroll, ep.tab_offset, w);
2660 scroll_amount = xp.vpos - XFASTINT (w->window_end_vpos); 2660 scroll_amount = xp.vpos - XFASTINT (w->window_end_vpos);
2661 2661
2662 /* Is everything on frame below the changes whitespace? 2662 /* Is everything on frame below the changes whitespace?
2663 If so, no scrolling is really necessary. */ 2663 If so, no scrolling is really necessary. */
2664 for (i = ep.bufpos; i < xp.bufpos; i++) 2664 for (i = ep.bytepos; i < xp.bytepos; i++)
2665 { 2665 {
2666 tem = FETCH_BYTE (i); 2666 tem = FETCH_BYTE (i);
2667 if (tem != ' ' && tem != '\n' && tem != '\t') 2667 if (tem != ' ' && tem != '\n' && tem != '\t')
2668 break; 2668 break;
2669 } 2669 }
2670 if (i == xp.bufpos) 2670 if (i == xp.bytepos)
2671 return -2; 2671 return -2;
2672 2672
2673 XSETFASTINT (w->window_end_vpos, 2673 XSETFASTINT (w->window_end_vpos,
2674 XFASTINT (w->window_end_vpos) + scroll_amount); 2674 XFASTINT (w->window_end_vpos) + scroll_amount);
2675 2675
2822 if (val.vpos) tab_offset = 0; 2822 if (val.vpos) tab_offset = 0;
2823 #endif 2823 #endif
2824 if (pos != val.bufpos) 2824 if (pos != val.bufpos)
2825 last_text_vpos 2825 last_text_vpos
2826 /* Next line, unless prev line ended in end of buffer with no cr */ 2826 /* Next line, unless prev line ended in end of buffer with no cr */
2827 = vpos - (val.vpos && FETCH_BYTE (val.bufpos - 1) != '\n'); 2827 = vpos - (val.vpos && FETCH_BYTE (val.bytepos - 1) != '\n');
2828 pos = val.bufpos; 2828 pos = val.bufpos;
2829 } 2829 }
2830 2830
2831 /* There are two cases: 2831 /* There are two cases:
2832 1) we have displayed down to the bottom of the window 2832 1) we have displayed down to the bottom of the window
2875 /* If we are starting display in mid-character, correct tab_offset 2875 /* If we are starting display in mid-character, correct tab_offset
2876 to account for passing the line that that character starts in. */ 2876 to account for passing the line that that character starts in. */
2877 if (val.hpos < lmargin) 2877 if (val.hpos < lmargin)
2878 tab_offset += width; 2878 tab_offset += width;
2879 #endif 2879 #endif
2880 val.bytepos = pos; 2880 val.bytepos = pos_byte;
2881 while (vpos < height) 2881 while (vpos < height)
2882 { 2882 {
2883 val = *display_text_line (w, pos, val.bytepos, 2883 val = *display_text_line (w, pos, val.bytepos,
2884 top + vpos++, val.hpos, 2884 top + vpos++, val.hpos,
2885 val.tab_offset, val.ovstring_chars_done); 2885 val.tab_offset, val.ovstring_chars_done);