[polari] chatView: Don't mingle separating whitespace with nick



commit c08a2a1455b6391abecbec18954a167c56c1db3e
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 28 22:57:02 2015 +0200

    chatView: Don't mingle separating whitespace with nick
    
    We get away with piggy-backing the '\t' character that separates nick
    and message with the former as long as the style we apply to the nick
    doesn't affect whitespace - this is about to change, so insert the
    whitespace separately.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760853

 src/chatView.js |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 123b640..681506a 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1187,6 +1187,7 @@ const ChatView = new Lang.Class({
                 let tags = [this._lookupTag('nick')];
                 let nickTagName = this._getNickTagName(message.nick);
                 let nickTag = this._lookupTag(nickTagName);
+                let buffer = this._view.get_buffer();
 
                 if (!nickTag) {
                     nickTag = new Gtk.TextTag({ name: nickTagName });
@@ -1194,12 +1195,13 @@ const ChatView = new Lang.Class({
                     let status = this._userTracker.getNickRoomStatus(message.nick, this._room);
                     this._updateNickTag(nickTag, status);
 
-                    this._view.get_buffer().get_tag_table().add(nickTag);
+                    buffer.get_tag_table().add(nickTag);
                 }
                 tags.push(nickTag);
                 if (needsGap)
                     tags.push(this._lookupTag('gap'));
-                this._insertWithTags(iter, message.nick + '\t', tags);
+                this._insertWithTags(iter, message.nick, tags);
+                buffer.insert(iter, '\t', -1);
             }
             state.lastNick = message.nick;
             tags.push(this._lookupTag('message'));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]