summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fe-text/gui-entry.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c
index be778224..c045de83 100644
--- a/src/fe-text/gui-entry.c
+++ b/src/fe-text/gui-entry.c
@@ -777,6 +777,13 @@ void gui_entry_move_pos(GUI_ENTRY_REC *entry, int pos)
if (entry->pos + pos >= 0 && entry->pos + pos <= entry->text_len)
entry->pos += pos;
+ if (entry->utf8) {
+ int step = pos < 0 ? -1 : 1;
+ while(mk_wcwidth(entry->text[entry->pos]) == 0 &&
+ entry->pos + step >= 0 && entry->pos + step <= entry->text_len)
+ entry->pos += step;
+ }
+
gui_entry_fix_cursor(entry);
gui_entry_draw(entry);
}