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-08 16:04:46 +0200
commit5fbd17e369ca30a47ab8a2eda0b2f2ea9b690bb4 (patch)
tree253a55de82ec0ae74ed1d05004be77439da0231b /src/dispnew.c
parentad83cdacb6808377e2ef4f96e60ffb68dbf01cd9 (diff)
downloademacs-5fbd17e369ca30a47ab8a2eda0b2f2ea9b690bb4.tar.gz
Fix line-move-visual's following of column in R2L lines.
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.)
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 b998e654881..cefcd0809a0 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5162,7 +5162,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;
@@ -5237,9 +5237,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;