From e553caecce3c5701439f1753e1273c040bda3fcb Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 23 Jan 2013 10:57:18 +0400 Subject: [PATCH] Ticket #2953: (edit_move_to_prev_col): fix floating point exception. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index e1c753fae..a9f685f99 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -3256,13 +3256,17 @@ edit_move_to_prev_col (WEdit * edit, off_t p) edit->over_col = 0; if (option_fake_half_tabs && is_in_indent (edit)) { + long fake_half_tabs; + edit_update_curs_col (edit); - if (space_width != 0 && edit->curs_col % (HALF_TAB_SIZE * space_width) != 0) + + fake_half_tabs = HALF_TAB_SIZE * space_width; + if (fake_half_tabs != 0 && edit->curs_col % fake_half_tabs != 0) { int q; q = edit->curs_col; - edit->curs_col -= (edit->curs_col % (HALF_TAB_SIZE * space_width)); + edit->curs_col -= (edit->curs_col % fake_half_tabs); p = edit_bol (edit, edit->curs1); edit_cursor_move (edit, edit_move_forward3 (edit, p, edit->curs_col, 0) - edit->curs1); -- 2.11.4.GIT