aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann1999-08-06 15:05:27 +0000
committerGerd Moellmann1999-08-06 15:05:27 +0000
commit862b479030730c1ddb60d9a6dc55e1f8a12e59eb (patch)
tree9f5c822a965dfd75a690078a529c3a186cebf9cf
parent66ac4b0e5fa32071fa60c7d4956786cc1d161245 (diff)
downloademacs-862b479030730c1ddb60d9a6dc55e1f8a12e59eb.tar.gz
emacs-862b479030730c1ddb60d9a6dc55e1f8a12e59eb.zip
(set_window_cursor_after_update): Correct cursor
position if cursor_in_echo_area:
-rw-r--r--src/dispnew.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index cac7a051767..4875f736b99 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4028,28 +4028,37 @@ set_window_cursor_after_update (w)
4028 line that has any text on it. Note: either all lines 4028 line that has any text on it. Note: either all lines
4029 are enabled or none. Otherwise we wouldn't be able to 4029 are enabled or none. Otherwise we wouldn't be able to
4030 determine Y. */ 4030 determine Y. */
4031 struct glyph_row *row = MATRIX_ROW (w->current_matrix, 0); 4031 struct glyph_row *row, *last_row;
4032 int vpos, last_row_vpos; 4032 struct glyph *glyph;
4033 struct glyph_row *last_row = NULL; 4033 int yb = window_text_bottom_y (w);
4034 4034
4035 vpos = 0; 4035 last_row = NULL;
4036 while (vpos < w->current_matrix->nrows) 4036 for (row = MATRIX_ROW (w->current_matrix, 0);; ++row)
4037 { 4037 {
4038 if (row->enabled_p && row->used[TEXT_AREA]) 4038 if (row->used[TEXT_AREA]
4039 { 4039 && row->glyphs[TEXT_AREA][0].charpos >= 0)
4040 last_row = row; 4040 last_row = row;
4041 last_row_vpos = vpos;
4042 }
4043 ++row;
4044 ++vpos;
4045 }
4046 4041
4042 if (MATRIX_ROW_BOTTOM_Y (row) >= yb)
4043 break;
4044 }
4045
4047 if (last_row) 4046 if (last_row)
4048 { 4047 {
4049 cx = last_row->pixel_width; 4048 struct glyph *start = row->glyphs[TEXT_AREA];
4050 hpos = last_row->used[TEXT_AREA]; 4049 struct glyph *last = start + row->used[TEXT_AREA];
4050
4051 while (last > start && (last - 1)->charpos < 0)
4052 --last;
4053
4054 for (glyph = start; glyph < last; ++glyph)
4055 {
4056 cx += glyph->pixel_width;
4057 ++hpos;
4058 }
4059
4051 cy = last_row->y; 4060 cy = last_row->y;
4052 vpos = last_row_vpos; 4061 vpos = MATRIX_ROW_VPOS (last_row, w->current_matrix);
4053 } 4062 }
4054 } 4063 }
4055 } 4064 }