From: Eli Zaretskii Date: Sat, 1 May 2010 15:53:35 +0000 (+0300) Subject: Fix cursor positioning in partial width windows on TTY. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~319^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b47e0dcf2db5d0f754342f0eb13e53974bfbefbe;p=emacs.git Fix cursor positioning in partial width windows on TTY. xdisp.c (set_cursor_from_row): Don't place cursor on the vertical border glyph between adjacent windows. (try_cursor_movement): Don't assume that row->end == (row+1)->start, test for that explicitly. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7becf77dde9..4de1618f4d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -7,6 +7,10 @@ (display_line): Fix prepending of truncation glyphs to R2L rows. (insert_left_trunc_glyphs): Support addition of left truncation glyphs to R2L rows. + (set_cursor_from_row): Don't place cursor on the vertical border + glyph between adjacent windows. + (try_cursor_movement): Don't assume that row->end == (row+1)->start, + test for that explicitly. 2010-04-27 Eli Zaretskii diff --git a/src/xdisp.c b/src/xdisp.c index 6d0683ba566..6d906825d1e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12776,6 +12776,13 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) rightmost glyph. Case in point: an empty last line that is part of an R2L paragraph. */ cursor = end - 1; + /* Avoid placing the cursor on the last glyph of the row, where + on terminal frames we hold the vertical border between + adjacent windows. */ + if (!FRAME_WINDOW_P (WINDOW_XFRAME (w)) + && !WINDOW_RIGHTMOST_P (w) + && cursor == row->glyphs[LAST_AREA] - 1) + cursor--; x = -1; /* will be computed below, at label compute_x */ } @@ -13716,11 +13723,14 @@ try_cursor_movement (window, startp, scroll_step) ++row; } - /* The end position of a row equals the start position - of the next row. If PT is there, we would rather - display it in the next line. */ + /* If the end position of a row equals the start + position of the next row, and PT is at that position, + we would rather display cursor in the next line. */ while (MATRIX_ROW_BOTTOM_Y (row) < last_y && MATRIX_ROW_END_CHARPOS (row) == PT + && row < w->current_matrix->rows + + w->current_matrix->nrows - 1 + && MATRIX_ROW_START_CHARPOS (row+1) == PT && !cursor_row_p (w, row)) ++row;