From 52a2f5379ea986925a627edd3f8342856b4eff7c Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Mon, 27 Apr 2009 12:16:53 +0000 Subject: [PATCH] fix: draw cursor on non-utf-8 console if a character is typically rendered in a double-width cell. --- edit/edit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/edit/edit.c b/edit/edit.c index 8b48a1f80..e2feabb1a 100644 --- a/edit/edit.c +++ b/edit/edit.c @@ -1475,8 +1475,10 @@ long edit_move_forward3 (WEdit * edit, long current, int cols, long upto) c = edit_get_byte (edit, p); utf_ch = edit_get_utf (edit, p, &cw); } - if ( edit->utf8 && g_unichar_iswide(utf_ch) ) - col++; + if ( utf8_display ) { + if ( edit->utf8 && g_unichar_iswide(utf_ch) ) + col++; + } if (c == '\t') col += TAB_SIZE - col % TAB_SIZE; else if (c == '\n') {