gwibber-bugs team mailing list archive
-
gwibber-bugs team
-
Mailing list archive
-
Message #02791
[Bug 646861] Re: Support for live unicode character replacement
"Thanks for your patch, unfortunately our busy developers haven't been
able to review your patch in a timely manor. The gwibber codebase has
seen significant change and it is likely this patch no longer applies.
Please review it again and if it is still applicable, update it to work
with the latest gwibber trunk. We will be doing a patch review day in
the next few weeks and would like to review your patch. Thanks again for
your contribution!"
** Changed in: gwibber
Status: New => Incomplete
** Tags added: patch-day-old
--
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:
Incomplete
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