comparison src/xdisp.c @ 21335:8f9e7600c250

(redisplay_window): Fix computing pos from last_point.
author Richard M. Stallman <rms@gnu.org>
date Thu, 02 Apr 1998 04:40:52 +0000
parents d5dab6049412
children fbfd26142e76
comparison
equal deleted inserted replaced
21334:66b3b9fe3e3c 21335:8f9e7600c250
2031 clipped to the window edges. */ 2031 clipped to the window edges. */
2032 && !(last_point_x <= 0 && hscroll)) 2032 && !(last_point_x <= 0 && hscroll))
2033 { 2033 {
2034 int last_point = XFASTINT (w->last_point); 2034 int last_point = XFASTINT (w->last_point);
2035 int last_point_byte = CHAR_TO_BYTE (last_point); 2035 int last_point_byte = CHAR_TO_BYTE (last_point);
2036 int tab_offset = (pos_tab_offset (w, last_point, last_point_byte)
2037 - (last_point_x + hscroll - !! hscroll));
2036 2038
2037 pos = *compute_motion (last_point, last_point_y, last_point_x, 0, 2039 pos = *compute_motion (last_point, last_point_y, last_point_x, 0,
2038 PT, height, 2040 PT, height,
2039 /* BUG FIX: See the comment of 2041 /* BUG FIX: See the comment of
2040 Fpos_visible_in_window_p (window.c). */ 2042 Fpos_visible_in_window_p (window.c). */
2041 - (1 << (BITS_PER_SHORT - 1)), 2043 - (1 << (BITS_PER_SHORT - 1)),
2042 width, hscroll, 2044 width, hscroll,
2043 pos_tab_offset (w, last_point, last_point_byte), 2045 tab_offset,
2044 w); 2046 w);
2045 } 2047 }
2046 else 2048 else
2047 { 2049 {
2048 pos = *compute_motion (startp, 0, (hscroll ? 1 - hscroll : 0), 0, 2050 pos = *compute_motion (startp, 0, (hscroll ? 1 - hscroll : 0), 0,
3046 #endif 3048 #endif
3047 return glyph; 3049 return glyph;
3048 } 3050 }
3049 3051
3050 /* Return the column of position POS / POS_BYTE in window W's buffer. 3052 /* Return the column of position POS / POS_BYTE in window W's buffer.
3051 The result is rounded down to a multiple of the internal width of W. 3053 When used on the character at the beginning of a line,
3052 This is the amount of indentation of position POS 3054 starting at column 0, this says how much to subtract from
3053 that is not visible in its horizontal position in the window. */ 3055 the column position of any character in the line
3056 to get its horizontal position on the screen. */
3054 3057
3055 static int 3058 static int
3056 pos_tab_offset (w, pos, pos_byte) 3059 pos_tab_offset (w, pos, pos_byte)
3057 struct window *w; 3060 struct window *w;
3058 register int pos, pos_byte; 3061 register int pos, pos_byte;