imwayland: Fix typo in code
To find the middle of the string, we should check both cursor/anchor. This is actually a backport of commit 8fc360dac5e4 in master. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2522
This commit is contained in:
parent
5be08a4d09
commit
965a85a0d3
@ -320,7 +320,7 @@ notify_surrounding_text (GtkIMContextWayland *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mid = MIN (context->surrounding.cursor_idx,
|
mid = MIN (context->surrounding.cursor_idx,
|
||||||
context->surrounding.cursor_idx) + (cursor_len / 2);
|
context->surrounding.anchor_idx) + (cursor_len / 2);
|
||||||
a = MAX (0, mid - (MAX_LEN / 2));
|
a = MAX (0, mid - (MAX_LEN / 2));
|
||||||
b = MIN (MAX_LEN, mid + (MAX_LEN / 2));
|
b = MIN (MAX_LEN, mid + (MAX_LEN / 2));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user