aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-02 06:39:39 +0000
committerRichard M. Stallman1998-05-02 06:39:39 +0000
commitdbcb258a896ce3b35a917d288e053e837f6c8270 (patch)
treee6652d7dcabf668aeadfe0fc7715b14e2fabd20a
parentf4a4528da49b2b1b0cace3f65da48b5c58a8aefb (diff)
downloademacs-dbcb258a896ce3b35a917d288e053e837f6c8270.tar.gz
emacs-dbcb258a896ce3b35a917d288e053e837f6c8270.zip
(XTwrite_glyphs): Don't advance cursor X beyond limit.
(XTcursor_to): Likewise.
-rw-r--r--src/xterm.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c
index aec85854ce6..fe77464296a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -483,8 +483,16 @@ XTcursor_to (row, col)
483{ 483{
484 int mask; 484 int mask;
485 int orow = row; 485 int orow = row;
486 struct frame *f;
487
488 f = updating_frame;
489 if (f == 0)
490 f = selected_frame;
486 491
487 curs_x = col; 492 curs_x = col;
493 if (curs_x >= FRAME_CURSOR_X_LIMIT (f))
494 curs_x = FRAME_CURSOR_X_LIMIT (f) - 1;
495
488 curs_y = row; 496 curs_y = row;
489 497
490 if (updating_frame == 0) 498 if (updating_frame == 0)
@@ -1204,8 +1212,8 @@ XTwrite_glyphs (start, len)
1204 f = selected_frame; 1212 f = selected_frame;
1205 /* If not within an update, 1213 /* If not within an update,
1206 output at the frame's visible cursor. */ 1214 output at the frame's visible cursor. */
1207 curs_x = f->cursor_x; 1215 curs_x = FRAME_CURSOR_X (f);
1208 curs_y = f->cursor_y; 1216 curs_y = FRAME_CURSOR_Y (f);
1209 } 1217 }
1210 1218
1211 dumpglyphs (f, 1219 dumpglyphs (f,
@@ -1219,10 +1227,13 @@ XTwrite_glyphs (start, len)
1219 && curs_x + len > f->phys_cursor_x) 1227 && curs_x + len > f->phys_cursor_x)
1220 f->phys_cursor_on = 0; 1228 f->phys_cursor_on = 0;
1221 1229
1230 curs_x += len;
1231 if (curs_x >= FRAME_CURSOR_X_LIMIT (f))
1232 curs_x = FRAME_CURSOR_X_LIMIT (f) - 1;
1233
1222 if (updating_frame == 0) 1234 if (updating_frame == 0)
1223 x_display_cursor (f, 1, FRAME_CURSOR_X (f) + len, FRAME_CURSOR_Y (f)); 1235 x_display_cursor (f, 1, curs_x, FRAME_CURSOR_Y (f));
1224 else 1236
1225 curs_x += len;
1226 1237
1227 UNBLOCK_INPUT; 1238 UNBLOCK_INPUT;
1228} 1239}