This change removes the assertions limiting replacement strings in the compose table to be less than 20 characters.
The limit seems arbitrary, is not required, will break some users' setups, and problems with it result in applications not launching.
Fixes #4273
}
else
{
- g_assert (strlen (value) < 20);
-
if (char_data->len > 0)
g_string_append_c (char_data, 0);
int char_offset = encoded_value & ~(1 << 15);
g_assert (char_offset < table->n_chars);
value = &table->char_data[char_offset];
- g_assert (strlen (value) < 20);
}
else
{
<Multi_key> <e> <m> <m> <e> <n> <t> <a> <l> <e> <r> : "🧀"
+<Multi_key> <t> <m> <y> <k> : "the mooore you knooow 💫"
-# n_sequences: 1
+# n_sequences: 2
# max_seq_len: 11
# n_index_size: 1
-# data_size: 23
-# n_chars: 5
+# data_size: 28
+# n_chars: 32
+<Uff20> <U74> <U6d> <U79> <U6b> : "the mooore you knooow 💫"
<Uff20> <U65> <U6d> <U6d> <U65> <U6e> <U74> <U61> <U6c> <U65> <U72> : "🧀" # U1f9c0
<Multi_key> <s> <e> <q> : "!"
<Multi_key> <s> <e> <q> <u> : "?"
<Multi_key> <z> <w> <i> <n> <e> <s> : "🥂"
+<Multi_key> <l> <o> <n> <g> : "this is a long replacement string"
-# n_sequences: 3
+# n_sequences: 4
# max_seq_len: 7
# n_index_size: 1
-# data_size: 24
-# n_chars: 5
+# data_size: 29
+# n_chars: 39
<Uff20> <U73> <U65> <U71> : "!" # U21
+<Uff20> <U6c> <U6f> <U6e> <U67> : "this is a long replacement string"
<Uff20> <U73> <U65> <U71> <U75> : "?" # U3f
<Uff20> <U7a> <U77> <U69> <U6e> <U65> <U73> : "🥂" # U1f942
g_assert_true (match);
g_assert_cmpstr (output->str, ==, "?");
+ g_string_set_size (output, 0);
+
+ buffer[0] = GDK_KEY_Multi_key;
+ buffer[1] = GDK_KEY_l;
+ buffer[2] = GDK_KEY_o;
+ buffer[3] = GDK_KEY_n;
+ buffer[4] = GDK_KEY_g;
+ ret = gtk_compose_table_check (table, buffer, 5, &finish, &match, output);
+ g_assert_true (ret);
+ g_assert_true (finish);
+ g_assert_true (match);
+ g_assert_cmpstr (output->str, ==, "this is a long replacement string");
+
g_string_free (output, TRUE);
g_free (file);
}