gwibber-bugs team mailing list archive
-
gwibber-bugs team
-
Mailing list archive
-
Message #03279
[Bug 646861] Re: Support for live unicode character replacement
This patch no longer applies, as the UI has been rewritten in Vala.
However, the patch is also wrong as it seems to have "unicode"
characters encoded in ISO-8859-15 perhaps, rather than the actual UTF-8
characters. Perhaps the same functinality would be useful in the Vala
version, but a new patch would need to be written.
** Tags removed: patch-day-old
** Changed in: gwibber
Status: Incomplete => Triaged
--
You received this bug notification because you are a member of Gwibber
Bug Heros, which is subscribed to Gwibber.
https://bugs.launchpad.net/bugs/646861
Title:
Support for live unicode character replacement
Status in Gwibber:
Triaged
Bug description:
As requested here
(https://bugzilla.redhat.com/show_bug.cgi?id=634789), I looked into
adding support for replacing common multi-character strings with their
single character unicode equivalent, to minimize character count for
microblog services which have a limit (which is pretty much all of
them).
Specifically, "..." and "--" can be simplified to "…" and "—".
I hacked together a patch for this, but I admit it is not pretty. It
does work for me, but the console doesn't love it, as I get:
found ... trying to replace
/usr/bin/gwibber:73: GtkWarning: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
gtk.main()
/usr/bin/gwibber:73: GtkWarning: _gtk_text_buffer_get_line_log_attrs: assertion `GTK_IS_TEXT_BUFFER (buffer)' failed
gtk.main()
/usr/bin/gwibber:73: GtkWarning: IA__gtk_text_buffer_remove_tag: assertion `gtk_text_iter_get_buffer (end) == buffer' failed
gtk.main()
** (gwibber:11855): CRITICAL **: enchant_dict_check: assertion `len' failed
/usr/bin/gwibber:73: GtkWarning: gtk_text_buffer_set_mark: assertion `gtk_text_iter_get_buffer (iter) == buffer' failed
gtk.main()
I can't seem to find a good example of searching for a string in a
textbuf, and replacing it in place whenever found. I did it without
using marks or iters, which is why the warnings get thrown. I'm
attaching this patch as a starting point, with the hope that someone
who understands textbufs better than I do will clean it up a bit so it
is no longer such a warning generator.
To manage notifications about this bug go to:
https://bugs.launchpad.net/gwibber/+bug/646861/+subscriptions