summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-01-08 16:04:46 +0200
committerEli Zaretskii <eliz@gnu.org>2015-01-09 11:06:18 +0200
commit7c0bfa1d0803d824e3adaf9c6431997580771ef6 (patch)
treefda2be0d3c305debeaba26f242830141d4444709 /src/dispnew.c
parent2a57b7e5b42175031efb8b4348638a05cb1c52a2 (diff)
downloademacs-7c0bfa1d0803d824e3adaf9c6431997580771ef6.tar.gz
Fix line-move-visual's following of column in R2L lines (backport from trunk).
src/simple.el (line-move-visual): When converting X pixel coordinate to temporary-goal-column, adjust the value for right-to-left screen lines. This fixes vertical-motion, next/prev-line, etc. src/dispnew.c (buffer_posn_from_coords): Fix the value of the column returned for right-to-left screen lines. (Before the change on 2014-12-30, the incorrectly-computed X pixel coordinate concealed this bug.) (cherry picked from commit 5fbd17e369ca30a47ab8a2eda0b2f2ea9b690bb4) Conflicts: lisp/simple.el
Diffstat (limited to 'src/dispnew.c')
-rw-r--r--src/dispnew.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 205c28f7df8..f73ea58b7f3 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5153,7 +5153,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
Fset_buffer (old_current_buffer);
- *dx = x0 + it.first_visible_x - it.current_x;
+ *dx = to_x - it.current_x;
*dy = *y - it.current_y;
string = w->contents;
@@ -5228,9 +5228,9 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
}
/* Add extra (default width) columns if clicked after EOL. */
- x1 = max (0, it.current_x + it.pixel_width - it.first_visible_x);
- if (x0 > x1)
- it.hpos += (x0 - x1) / WINDOW_FRAME_COLUMN_WIDTH (w);
+ x1 = max (0, it.current_x + it.pixel_width);
+ if (to_x > x1)
+ it.hpos += (to_x - x1) / WINDOW_FRAME_COLUMN_WIDTH (w);
*x = it.hpos;
*y = it.vpos;