diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-01-08 16:04:46 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-01-09 11:06:18 +0200 |
commit | 7c0bfa1d0803d824e3adaf9c6431997580771ef6 (patch) | |
tree | fda2be0d3c305debeaba26f242830141d4444709 /src | |
parent | 2a57b7e5b42175031efb8b4348638a05cb1c52a2 (diff) | |
download | emacs-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')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/dispnew.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index acd7e729254..25f3264198d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2015-01-08 Eli Zaretskii <eliz@gnu.org> + + * 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.) + 2015-01-05 Eli Zaretskii <eliz@gnu.org> * xdisp.c (move_it_to, try_cursor_movement): Don't use the window 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; |