From 1ceb2494e437b375c3edc8b8bd21802c95da5688 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 26 Jan 2011 13:30:16 +0300 Subject: [PATCH] Fixup compile with --disable-charset. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index 1eb42563d..8551c8f91 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -2942,10 +2942,7 @@ edit_move_forward3 (WEdit * edit, long current, int cols, long upto) for (col = 0, p = current; p < q; p++) { int c, orig_c; - int utf_ch = 0; -#ifdef HAVE_CHARSET - int cw = 1; -#endif + if (cols != -10) { if (col == cols) @@ -2953,10 +2950,15 @@ edit_move_forward3 (WEdit * edit, long current, int cols, long upto) if (col > cols) return p - 1; } + orig_c = c = edit_get_byte (edit, p); + #ifdef HAVE_CHARSET if (edit->utf8) { + int utf_ch; + int cw = 1; + utf_ch = edit_get_utf (edit, p, &cw); if (utf8_display) { @@ -2968,8 +2970,10 @@ edit_move_forward3 (WEdit * edit, long current, int cols, long upto) else if (cw > 1 && g_unichar_isprint (utf_ch)) col -= cw - 1; } -#endif + c = convert_to_display_c (c); +#endif + if (c == '\t') col += TAB_SIZE - col % TAB_SIZE; else if (c == '\n') -- 2.11.4.GIT