[polari/gnome-3-18] room: Highlight message on special characters preceding nick



commit b2f60b77e96692b4fe17748cccfb636ff4316d5f
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]