diff options
| -rw-r--r-- | src/msdos.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/msdos.c b/src/msdos.c index f26ddd868a3..85ff6dd94a6 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -1360,6 +1360,11 @@ fast_find_position (struct window *w, int pos, int *hpos, int *vpos) | |||
| 1360 | } | 1360 | } |
| 1361 | else if (line_start_position > 0) | 1361 | else if (line_start_position > 0) |
| 1362 | best_row = row; | 1362 | best_row = row; |
| 1363 | |||
| 1364 | /* Don't overstep the last matrix row, lest we get into the | ||
| 1365 | never-never land... */ | ||
| 1366 | if (row->y + 1 >= yb) | ||
| 1367 | break; | ||
| 1363 | 1368 | ||
| 1364 | ++row; | 1369 | ++row; |
| 1365 | } | 1370 | } |
| @@ -1456,7 +1461,7 @@ static void | |||
| 1456 | IT_note_mouse_highlight (struct frame *f, int x, int y) | 1461 | IT_note_mouse_highlight (struct frame *f, int x, int y) |
| 1457 | { | 1462 | { |
| 1458 | struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 1463 | struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 1459 | int portion; | 1464 | int portion = -1; |
| 1460 | Lisp_Object window; | 1465 | Lisp_Object window; |
| 1461 | struct window *w; | 1466 | struct window *w; |
| 1462 | 1467 | ||
| @@ -1515,16 +1520,22 @@ IT_note_mouse_highlight (struct frame *f, int x, int y) | |||
| 1515 | && (XFASTINT (w->last_overlay_modified) | 1520 | && (XFASTINT (w->last_overlay_modified) |
| 1516 | == BUF_OVERLAY_MODIFF (XBUFFER (w->buffer)))) | 1521 | == BUF_OVERLAY_MODIFF (XBUFFER (w->buffer)))) |
| 1517 | { | 1522 | { |
| 1518 | int pos, i, area; | 1523 | int pos, i; |
| 1519 | struct glyph_row *row; | 1524 | struct glyph_row *row; |
| 1520 | struct glyph *glyph; | 1525 | struct glyph *glyph; |
| 1526 | int nrows = w->current_matrix->nrows; | ||
| 1521 | 1527 | ||
| 1522 | /* Find the glyph under X/Y. */ | 1528 | /* Find the glyph under X/Y. */ |
| 1523 | glyph = NULL; | 1529 | glyph = NULL; |
| 1524 | if (y < w->current_matrix->nrows) | 1530 | if (y >= 0 && y < nrows) |
| 1525 | { | 1531 | { |
| 1526 | row = MATRIX_ROW (w->current_matrix, y); | 1532 | row = MATRIX_ROW (w->current_matrix, y); |
| 1527 | if (row->enabled_p | 1533 | /* Give up if some row before the one we are looking for is |
| 1534 | not enabled. */ | ||
| 1535 | for (i = 0; i <= y; i++) | ||
| 1536 | if (!MATRIX_ROW (w->current_matrix, i)->enabled_p) | ||
| 1537 | break; | ||
| 1538 | if (i > y /* all rows upto and including the one at Y are enabled */ | ||
| 1528 | && row->displays_text_p | 1539 | && row->displays_text_p |
| 1529 | && x < window_box_width (w, TEXT_AREA)) | 1540 | && x < window_box_width (w, TEXT_AREA)) |
| 1530 | { | 1541 | { |