summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-06-29 13:56:50 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-06-29 13:56:50 +0000
commitbaed8445dd2b64d5aaa19fcf110ae05ce591f4d6 (patch)
tree8c2168f76dc3b440818de43f89cd21aef3c02451 /src/indent.c
parentb861de913e16a1bd216e87797cae1a8d1c0d8421 (diff)
downloademacs-baed8445dd2b64d5aaa19fcf110ae05ce591f4d6.tar.gz
(Fvertical_motion): Properly handle float column arg.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c
index 71e993e31a2..be5dc5f667f 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2020,12 +2020,14 @@ whether or not it is currently displayed in some window. */)
struct window *w;
Lisp_Object old_buffer;
struct gcpro gcpro1;
- int cols = 0;
+ Lisp_Object lcols = Qnil;
+ double cols;
/* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
if (CONSP (lines) && (NUMBERP (XCAR (lines))))
{
- cols = XINT (XCAR (lines));
+ lcols = XCAR (lines);
+ cols = INTEGERP (lcols) ? (double) XINT (lcols) : XFLOAT_DATA (lcols);
lines = XCDR (lines);
}
@@ -2116,10 +2118,11 @@ whether or not it is currently displayed in some window. */)
if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0)
move_it_by_lines (&it, XINT (lines), 0);
- if (cols)
- move_it_in_display_line (&it, ZV,
- cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)),
- MOVE_TO_X);
+ if (!NILP (lcols))
+ move_it_in_display_line
+ (&it, ZV,
+ (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
+ MOVE_TO_X);
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
}