[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: Sat, 1 Oct 2016 19:20:41 +0000 (UTC)
commit 1e3818a6331cdcba8e70fb3d1968873b6018c2a8
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 4abd6b6..f86e19d 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1186,18 +1186,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]