Skip to content

Fix text preview and some small issues

Hello!

This MR fixes the following issues with the preview text:

  1. At present, if you copy 1234 then the preview text will be 1234 (Notice the leading space). After this MR is applied it correctly removes the leading space
  2. Currently, g_strstr_len() is called inefficiently (multiple times with same leading string text). This patch calls g_strstr_len() only on the non-parsed text.
  3. At present, if the copied text is much longer than preview_length then g_strchomp() is called inefficiently. There is no use of chomping that long string.
  4. The present way of chomping also means if you copy 12345678901234567890123456789012345678901234567 90 then the preview text is 12345678901234567890123456789012345678901234567 (notice the trailing whitechar). This MR correctly chomps the whitespace from preview text.

Thanks!

Merge request reports