[polari] room: Highlight message on special characters preceding nick
- From: Kunal Jain <kunaljain src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] room: Highlight message on special characters preceding nick
- Date: Sun, 18 Oct 2015 09:36:15 +0000 (UTC)
commit 7ea7ee377abff6ad2725fd192ce4f141afec9f1e
Author: Kunaal Jain <kunaalus gmail com>
Date: Sun Oct 18 13:56:03 2015 +0530
room: Highlight message on special characters preceding nick
Since commit 2d06b9e, we have been highlighting messages
only if space proceed or non aplhanumeric character follow,
due to this mentions like @nick, #nick are not highlighted.
So instead of space, highlight if any non aplhanumeric
character follow.
https://bugzilla.gnome.org/show_bug.cgi?id=756761
src/lib/polari-room.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/lib/polari-room.c b/src/lib/polari-room.c
index 5dc074c..3ecc541 100644
--- a/src/lib/polari-room.c
+++ b/src/lib/polari-room.c
@@ -158,7 +158,7 @@ polari_room_should_highlight_message (PolariRoom *room,
gboolean starts_word, ends_word;
/* assume ASCII nicknames, so no complex pango-style breaks */
- starts_word = (match == text || g_ascii_isspace (*(match - 1)));
+ starts_word = (match == text || !g_ascii_isalnum (*(match - 1)));
ends_word = !g_ascii_isalnum (*(match + len));
result = starts_word && ends_word;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]