summaryrefslogtreecommitdiff
path: root/src/text_buffer.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-05-17 01:00:35 +0200
committermathieui <mathieui@mathieui.net>2012-05-17 01:00:35 +0200
commit0f7bda20b8b89bf334d67da45f4fc3e4dc8117f9 (patch)
tree7ed6d0e0b6b80544ff40eeb57daad0d7d8c0eac1 /src/text_buffer.py
parentda30c8c79f5950ef85296ba8f749b929b1bbbd57 (diff)
downloadpoezio-0f7bda20b8b89bf334d67da45f4fc3e4dc8117f9.tar.gz
poezio-0f7bda20b8b89bf334d67da45f4fc3e4dc8117f9.tar.bz2
poezio-0f7bda20b8b89bf334d67da45f4fc3e4dc8117f9.tar.xz
poezio-0f7bda20b8b89bf334d67da45f4fc3e4dc8117f9.zip
Add a way to review room highlights - Fixes #1673
This new features is available with M-p and M-n (previous/next). It saves the last highlight viewed, meaning that if you scroll in the buffer, M-n or M-p will take you to the next or previous hl compared to the one before you started scrolling. For convenience, going to the previous highlight of the first highlight will take you to the bottom of the buffer, and going to the next highlight of the last highlight will do *the same*. If there are several highlights in one message, only the first line will be considered a highlight.
Diffstat (limited to 'src/text_buffer.py')
-rw-r--r--src/text_buffer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/text_buffer.py b/src/text_buffer.py
index 9b717882..2d83ab7e 100644
--- a/src/text_buffer.py
+++ b/src/text_buffer.py
@@ -35,7 +35,7 @@ class TextBuffer(object):
def add_window(self, win):
self.windows.append(win)
- def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None, user=None):
+ def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None, user=None, highlight=False):
time = time or datetime.now()
if txt.startswith('/me '):
if nick_color:
@@ -57,7 +57,7 @@ class TextBuffer(object):
ret_val = None
for window in self.windows: # make the associated windows
# build the lines from the new message
- nb = window.build_new_message(msg, history=history)
+ nb = window.build_new_message(msg, history=history, highlight=highlight)
if ret_val is None:
ret_val = nb
if window.pos != 0: