Skip combining marks in the editor

For slightly more correct Unicode handling.
This commit is contained in:
Přemysl Eric Janouch 2017-06-27 20:03:38 +02:00
parent b0e5055f42
commit 80306c5779
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 6 additions and 2 deletions

View File

@ -1486,14 +1486,18 @@ app_process_user_action (Application *self, UserAction action)
case USER_ACTION_INPUT_LEFT: case USER_ACTION_INPUT_LEFT:
if (self->input_pos > 0) if (self->input_pos > 0)
{ {
self->input_pos--; do self->input_pos--;
while (self->input_pos > 0 && g_unichar_ismark
(g_array_index (self->input, gunichar, self->input_pos)));
app_redraw_top (self); app_redraw_top (self);
} }
return TRUE; return TRUE;
case USER_ACTION_INPUT_RIGHT: case USER_ACTION_INPUT_RIGHT:
if (self->input_pos < self->input->len) if (self->input_pos < self->input->len)
{ {
self->input_pos++; do self->input_pos++;
while (self->input_pos < self->input->len && g_unichar_ismark
(g_array_index (self->input, gunichar, self->input_pos)));
app_redraw_top (self); app_redraw_top (self);
} }
return TRUE; return TRUE;