[polari/wip/raresv/nick-popover: 11/15] chatView: Don't mingle separating whitespace with nick
- From: Rares Visalom <raresvisalom src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/raresv/nick-popover: 11/15] chatView: Don't mingle separating whitespace with nick
- Date: Wed, 14 Sep 2016 22:58:14 +0000 (UTC)
commit fc80b2a019032f7d0da681f94b5bbc82ce3cca12
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 d634916..4427e0f 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1168,18 +1168,20 @@ 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 });
this._updateNickTag(nickTag, this._userTracker.getNickStatus(message.nick));
- 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]